33

i.e. Conjecture is that for every prime p, there exists an integer n such that $=^2−$ where q is prime.

e.g. $57593 = 240^2 - 7$

I assume it's either known / false / an entirely uninteresting result given the infinite number of squares and primes.

I'm (no doubt obviously) no mathematician - I was just working through Pythagorean primes with my son and how to play with them using python, taking it a little further we noticed this. We've tested it up to 1,000,000 ($999983 = 1000^2 - 17$) without finding any counter examples. It'd be nice to show him something formal around what we've seen.

Examples up to 10,000.

Thanks.

rich
  • 439
  • Just trying trial and error method:- {7-3=2²=4},{11-2=3²=9},{19-3=4²=16} ,but at 5² the minimum value of 'p' increases.The above mentioned values are the minimum values of 'p' and 'q'. – Nothing Dec 06 '24 at 14:28
  • 5
    I wouldn't think there was anyway to prove this...we, notably, haven't got any good tools for writing natural numbers as the sum of two primes. – lulu Dec 06 '24 at 14:32
  • 3
    It is equivalent to asking if, for every prime $p$, there is another prime $q$ such that $p+q$ is a square number. Whether the answer is 'yes' or 'no', proving it should be hard (if not impossible with the current tools). Sumsets of prime numbers are not well understood, and you are even restricting it to be the set ${p}$ with the set $\mathcal{P}$ where the latter denotes the set of prime numbers. – mertunsal Dec 06 '24 at 14:38
  • 4
    Definitely not an "uninteresting result." – Paul Dec 06 '24 at 15:08
  • 2
  • 1
    This is interesting. Makes you wonder if it's lower hanging fruit than twin primes or $x^2+1$ primality problem. – Daniel Donnelly Dec 07 '24 at 07:39
  • 1
    All conjectures with prime numbers are difficult (I could say impossible) to proove. For example, the very well known Goldbach's conjecture : by computer, we can check that each even number can be written as sum of 2 prime numbers. We can even check that the number of couples for a specific $2n$ is very big (many hundred couples for $2n$ around $1000000$), and nobody is able to proove it is at least $1$. – Lourrran Dec 07 '24 at 18:27
  • 1
    What you can do to illustrate this is to evaluate, for $p$ prime, how many $q$ (prime) exists, such that $q <p$ and $q+p$ is a perfect square. If the number of valid $q$ is big, it confirms that the conjecture is certainly correct. And it is Something that you can work with your son. But for a formal proove, I think you will have to wait for a long time. – Lourrran Dec 07 '24 at 18:27
  • 2
    See also here for related conjectures using similar probabilistic heuristic reasoning. – Bill Dubuque Dec 07 '24 at 19:44
  • 1
    Plot of (p, q) pairs for p<50,000 https://i.sstatic.net/pzOWtqMf.png – PM 2Ring Dec 08 '24 at 04:55
  • 1
    Sage plotting script: https://sagecell.sagemath.org/?z=eJxNUE1LAzEQvedXPFKQhMayXfBSyFWvPXgTLYubbaObZPJRBX%2D9JLtU5zS8efPem9ng0foRlKwziIe1IWi4tx73iGyDpzTQBYIUomRsSsHBFpNKCHOGdRRSwXu4%2DsLYaCZQjoLkgQGAg8Y0h5BEjqkIwha9lG1kp9WCoDX6hV8rmXJNHr2Ca9gcahpssW87uMMeZs6mYX2jTCHBwfolhpiDQi%5F%5FFOPtHLphdoLNp3auiP%2D4%5FxLEmoBRydB4eWVV9WKhsVd46E5d17HqS9W36ZzS4M9GLLxVsmpArz9pyIaS9aV9U4EfuIJbBlTybiAyfhTLryVjC5eHTy4ZO1ahYH3JgkpWyPbH6F6h2DIbzZclrnBOdpytN1lzN3yExBWmNDijn9PVSHbc5Uv4Fq0ZvozglOOO%5FJlL9gv0WY%5FL&lang=sage – PM 2Ring Dec 08 '24 at 04:56
  • @PM2Ring Those lines are interesting, I guess it's for a given square, where it repeatedly reappears for a larger p with a smaller q? – rich Dec 08 '24 at 08:35
  • 1
    @rich Yes, we often get runs repeating the same square. We can see that as horizontal lines by plotting m: https://i.sstatic.net/TAB5eEJj.png The plot of q/p gives repeated (hyperbolic?) arc patterns https://i.sstatic.net/omfEcyA4.png – PM 2Ring Dec 08 '24 at 10:35
  • The prime $p$ being given, for every square $n^2\gt p$, there exists a natural integer $x_n$ such that $p=n^2-x_n$. It seems unlikely to me that in the infinity of possible $x_n$ there is never a prime. The conjecture must be true. – Ataulfo Dec 11 '24 at 02:21
  • Playing with this problem on my calculator, every prime I checked had at least one lesser prime whose difference is a power of 2. I tried writing a program and letting it run all night, but the calculator (WP-34s emulator in an iPhone 8) crashed! Could this be due to yesterday's earthquake? I – richard1941 Dec 11 '24 at 04:03
  • We have $p=n^2-q\iff q=n^2-p$ so this problem refers to the Bunyakovsky's conjecture for the quadratic case $f(x)=x^2-p$. I remember that some years ago a lady published in the AMS bulletin a partial result on the quadratic case of the conjecture. This result might perhaps be useful for this problem.(I don't remember the exact dates or the name of the lady, but anyone who knows how to search the archives will be able to find the paper). – Ataulfo Dec 11 '24 at 16:45
  • Bunyakovsky's conjecture is unsolved, and probably difficult since we do not even know if $n^2 + 1 $, which is a special case, has infinitely many primes or not. – GraduateStudent Dec 11 '24 at 20:15
  • What the lady (Garrison) proved was the following: Let $x^k$ where $k\ge1$; for all natural integer $M$ there is a constant $c\ge0$ so that if $f(x)=x^k+c$ there are at least $M$ integers $n$ with $f(n)$ prime. After this result, it was widely generalized (Forman) and a consequence was that in fact the constant $c$ can take infinitely many values. – Ataulfo Dec 13 '24 at 21:43

2 Answers2

17

This seems to be unknown, and like many problems of this form, hard to approach. Indeed, in this case even if it was not true for some particular prime $p^*$, how would you even prove that $n^2-p^*$ is never prime?

This mathoverflow question is closely related, and like that question your result would follow from an unsolved conjecture (which is some evidence that it is likely to be true).

The standard heuristic for this sort of question also suggests it is likely to be true. It goes as follows. By the prime number theorem, there density of primes in a region around $m$ is about $1/\log m$. Instead of working with the primes, let's think about what would happen if we chose a random set $P$ by putting each integer $m\geq 3$ in $P$ independently with probability $1/\log m$. For a fixed value $k$, would there be an equation of the form $k=n^2-m$ for some $m\in P$? The answer to this is yes, since we have $\Pr(n^2-k\in P)\approx \frac{1}{2\log n}$ for $n$ large, and so $\sum_n\Pr(n^2-k\in P)=\infty$. When we have infinitely many independent events, and the sum of the probabilities is infinite, with probability $1$ one of them (in fact, infinitely many of them) will happen.

This heuristic suggests that an integer $k$ can be written in the form $n^2-p$ (for $p$ prime) in infinitely many different ways, unless there is a good reason why it can't. So far the only integers where we know of such a reason are a subset of the square numbers.

  • 3
    I think your statement around the heuristic might be too strong - I'd say these heuristics imply that if there are any counterexamples, they're small. But couple that with a search on the small numbers and I'd be convinced this is very likely true. – Michael Lugo Dec 06 '24 at 14:55
  • 3
    @MichaelLugo often, that's the case, because the heuristic merely says the total expected number of counterexamples is bounded, as it does e.g. for Goldbach's conjecture. But for this problem the heuristic gives a stronger answer that the total expected number of counterexamples is 0. – Especially Lime Dec 06 '24 at 15:00
  • 2
    To clarify, if you did the same calculation for Goldbach's conjecture: every even number (except $2$) is the sum of two numbers in $P$, the random version is true with positive probability, so there's a chance some small value will be a countereexample. But for this problem the random version is true with probability $1$. – Especially Lime Dec 06 '24 at 15:06
  • 3
    I think the Bateman-Horn conjecture (discussed in the MO link) is really the strongest evidence here. It's essentially the same kind of heuristic you're doing, but it gives a precise description of all cases where the naive heuristic fails (in this case, only when $p$ is replaced by a square), as well as an asymptotic for the frequency of primes. That, and it's stood up to 60+ years of scrutiny with no known or expected counterexamples. – Ravi Fernando Dec 06 '24 at 16:38
  • 2
    FWIW, Bateman-Horn implies the strengthening: for any non-square integer $k$ (possibly negative), there exist infinitely many primes of the form $q = n^2 - k$. – Ravi Fernando Dec 06 '24 at 16:41
  • 2
    Absolutely, a longstanding conjecture is much more convincing than this back-of-envelope calculation - but OP probably hasn't seen that calculation before, and it can be helpful for other problems. – Especially Lime Dec 06 '24 at 17:04
  • 1
    @EspeciallyLime ok, I see - basically because for Goldbach the size of the solutions are bounded, but not in this problem because we're subtracting. – Michael Lugo Dec 06 '24 at 17:21
0

Comment: I found this in a book which can help to formulate the matter.

Problem: Prove that any number $n>6$ can be expressed as the sum of two numbers prime to each other.

Solution:

case 1: the number is odd, we may write:

$n=2+(n-2)$

$(n-2)$ is also odd and is greater than unity and we have $(n, n-2)=1$

In this case one prime is always $2$.For example $21=2+19$.

case 2: For proving this when n is even A. Monkovsky gave this proof:

If $n=4k; k>1;\in \mathbb N$ we have:

$n=(2k-1)+(2k+1); 2k+1>2k-1>1$

The numbers $2k+1$ and $2k-1$ are two subsequent odd numbers which are prime to each other. For example take $k=3$ we get $n=12$ and we have $(5, 7)=1$.

If $n=4k+2; k>1$ then:

$n=(2k+3)+(2k-1); 2k+3>2k-1>1$

And numbers $(2k+3)$ and $(2k-1)$ are relatively primes.Because if $(2k+3)$ and $(2k-1)$ are divisible by $d$ the their difference must also be divisible by $d$:

$(2k+3)-(2k-1)=4$

but $d$ is a divisor of two odd numbers and is odd and can not divide $4$, that is:

$(2k+3, 2k-1)=1$

For our case $n$ is even and a perfect square, suppose it has the form $n=4k^2$; again we have:

$(2k^2+1, 2k^2-1)=1$

and in the form of $n=4k^2+2$ we have:

$(2k^2+3, 2k^2-1)=1$

Now we have to see the prime numbers of the forms $(2k^2+1)$, $(2k^2-1)$ and $(2k^2+3)$ are infinite or not. This is an old question by Euler that says: Are the number of primes in the form $x^2+1$ or generally $ax^2+bx+c$ infinite? Your experiment obviously deduces that they can be infinite. I could not find anything about this on the internet.

sirous
  • 12,694
  • 4
    This is a nice idea but doesn't quite apply here. "Infinitely many primes of the form $2k^2+1$" and "Infinitely many primes of the form $2k^2-1$" don't jointly imply that there are infinitely many cases in which both are prime. And even then, the conjecture is that all primes can be written in the given form. – Chris Lewis Dec 07 '24 at 10:22
  • 2
    Is there a confusion between "sum of two prime numbers" and "sum of two coprime numbers" in this answer, or am I missing something? – Stef Dec 07 '24 at 13:47
  • Not the exact problem posted, but sometimes a similar problem can yield a useful clue that leads someone to the needed answer. We need all the help we can get. – richard1941 Dec 11 '24 at 02:59
  • While playing with my calculator, every prime that I checked had a lesser prime with a difference a power of 2. Is this a worthy question to post here? (I'll have a computer check it up to the bazillions before I do so.) – richard1941 Dec 11 '24 at 04:06