How could I prove / disprove that every non-zero integer can be written in the form $p-x^2$ where $p$ is a prime and $x$ is a positive integer?

150 Views Asked by At

Question: Can every non-zero integer be written in the following form? $$p-x^2$$

I was thinking about if every non-zero integer could be written in the form $p-x^2$ where $p$ is a prime and $x$ is a positive integer so I ran a bit of code in python to see if there was a chance it may be true and it seemed promising.

I haven't seen the problem asked anywhere else so i thought I'd ask for help in proving (or maybe disproving) the result.

2

There are 2 best solutions below

0
On BEST ANSWER

The problem is equivalent to asking for which values of $n$ the function $f(x):\mathbb Z \rightarrow \mathbb Z$ given by $f(x) = x^2+n$ hits at least one prime value.

For positive $n$ we might think it does because of Bunyakovsky's conjecture (also, the case $n=1$ is Landau's fourth problem).

For $n=0$ it doesn't.

For negative $n$ that isn't of form $-k^2$ we would think it does because of Bunyakovsky's conjecture.

For negative $n$ of form $-k^2$ it is equivalent to $2k+1$ not being a prime.

1
On

If $-16=p-x^2$, then $p=(x+4)(x-4)$. So one of the factors is 1 or -1. So $x=-5,-3,3,5$. Also $x$ is at least 5 or at most -5 since primes are positive. But 9 is not prime.