# A curious pattern on primes congruent to $1$ mod $4$?

It is known that every prime $p$ that satisfies the title congruence can be expressed in the form $a^{2} + b^{2}$ for some integers $a,b$, and unique factorisation in $Z[i]$ ensures exactly one such representation for each $p \equiv 1 \mod 4$.

It seems at least one of $a-b, a+b$ is always a prime ? Is there any mathematical explanation for this ?

• The strong law of small numbers. Jan 6, 2016 at 23:25
• I think that $313=12^2+13^2$ is a counterexample. Jan 6, 2016 at 23:33
• @Isaac: From lhf's table below, lest you think that either $a-b$ or $a+b$ are squares or powers, a counterexample is $38-17 = 21,\;38+17 = 55$ and $38^2+17^2 = 1733$ is prime. Jan 7, 2016 at 3:38

This is not true for $p=41$ because, except for permutations and signs, the only possible values are $a=5$ and $b=4$ but $a-b=1$ and $a+b=9$, not primes.

Another counterexample is $p=353$, for which $a=17$ and $b=8$ but $a-b=9$ and $a+b=25$, both squares!

Here are the first few counterexamples:

\begin{array}{rccccc} p & a & b & a-b & a+b \\ 41 & 5 & 4 & 1 & 9 \\ 113 & 8 & 7 & 1 & 15 \\ 313 & 13 & 12 & 1 & 25 \\ 353 & 17 & 8 & 9 & 25 \\ 613 & 18 & 17 & 1 & 35 \\ 653 & 22 & 13 & 9 & 35 \\ 677 & 26 & 1 & 25 & 27 \\ 761 & 20 & 19 & 1 & 39 \\ 857 & 29 & 4 & 25 & 33 \\ 977 & 31 & 4 & 27 & 35 \\ \end{array}

• Thank you, the observation can probably be best explained by the strong law of small numbers (that is, becomes false for larger and larger values of $p$), as Nicholas pointed out earlier.
– ABD.
Jan 6, 2016 at 23:39
• $1$ and $9$ are also both squares :)
– Lynn
Jan 6, 2016 at 23:43
• Staring at this list, one wonders whether the asymptotic density of counterexamples among the primes congruent to $1 \pmod 4$ is in fact $1$. Jan 6, 2016 at 23:52
• @Travis, well, the density of primes that are sum of two fourth powers is $0$. See projecteuclid.org/download/pdf_1/euclid.nmj/1118800590. So the strong counterexamples become rarer...
– lhf
Jan 6, 2016 at 23:56
• @AndréNicolas, I've added another line to my table, which gives the smallest example that $a\pm b$ is not a square.
– lhf
Jan 7, 2016 at 0:35

Let $a+b=35$ and $a-b=9$. Neither is prime.

Then $a=22$ and $b=13$, and the sum $(22)^2+(13)^2$ is the prime $653$.

Remark: For nice examples of apparent patterns that disappear when we look at larger numbers, please see Richard Guy's The Strong Law of Small numbers.

• Indeed, indeed, indeed. The fallacies in reaching conclusions from a few examples are somewhat similar to the ex-post-facto "research results" from experiments that initially aimed to "prove" one thing, but did not do so, which left the experimenters looking around for some correlation between something and something-else in all their (possibly expensively acquired) data. Also, the understandable overlooking of all the "coincidences" that do not occur. :) Jan 6, 2016 at 23:56
• @Paul, I'm sorry to say that your thinking is flawed, and sounds more like an exposition of your own personal experience. Actually, this observation was made whilst the author was embarking on his usual habit of ''playing'' with numbers in his head.
– ABD.
Jan 7, 2016 at 0:06
• @Isaac., no, I didn't at all to mean that you'd interpolated something from something... only that it is inevitable that observations of (inevitably) small-scale thing will (seem to) produce correlations, or coincidences, which might ask for explanation. To illustrate how such disconnects flummox even very smart people, maybe google "bible code"... Jan 7, 2016 at 0:21