Section 13.2 At Most One Way For Primes
Most of the rest of this chapter is dedicated to proving what we can about how to write numbers as sums of squares. We will begin our proofs by talking about how many ways we can write some numbers as a sum of squares. Namely, we'll connect sums of squares to factorization.
Remember that the Brahmagupta-Fibonacci identity says that if two numbers are sums of two squares, so is their product. Remarkably, we can sort of do this backwards.
First, we need to say what we might mean by writing a number as a sum of squares in two essentially different ways. Compare
to the situation
We say the latter ways are essentially different.
It is not a coincidence that \(13\) is prime, while the number \(25\) which has two ways to be written is composite.
Fact 13.2.1.
If an odd number \(N\) is writeable in two essentially different (nonnegative) ways as a sum of two squares, then \(N=yz\text{,}\) where \(y,z>1\) and \(y,z\) are themselves writeable as sums of two squares.
Proof.
Assume first that
with \(a,c\) odd and \(b,d\) even nonnegative integers. Then, assuming \(a\geq c\) and \(d\geq b\text{,}\) let
Both \(k\) and \(n\) are even, and
Then we get that
There are some details remaining here, especially in terms of verifying all these numbers exist, but they mostly just use the definitions of gcd and parity. See Exercise Group 13.7.8–11.
Example 13.2.2.
Let's examine \(N=25\text{.}\) First, what are \(a,b,c,d\text{?}\)
Once you have computed them, you should confirm that \(k=\gcd(2,4)=2\text{,}\) \(n=\gcd(8,4)=4\) which means \(\ell=1\) and \(m=2\text{.}\) This yields
So \(25\) is a product of numbers, each themselves writeable as a sum of two squares.
Remark 13.2.3.
This method for factoring is apparently due to Euler; see Wikipedia, which references [E.5.3]. An interesting generalization for the situation where one has two different ways to write an odd integer as a sum of the form \(mx^2+ny^2\) for positive \(m,n\) may be found in [E.7.30].
It is now nearly trivial to prove the following.
Proposition 13.2.4.
A prime is writeable in zero or one (positive) way as a sum of two squares.
Proof.
This is clear for \(p=2\text{.}\) It remains to consider the case of \(p\) odd. If \(p\) is writeable in two different ways, it factors by Fact 13.2.1. But prime numbers don't factor nontrivially, so there must be just one way to do it.
Note that there could be zero ways to write \(p\text{.}\) If \(p>2\) odd happens to be \(p\equiv 3\text{ (mod }4)\text{,}\) Fact 13.1.1 says as much, so the use of Fact 13.2.1 in the first paragraph is really only being applied to \(p\equiv 1\text{ (mod }4)\text{.}\)
For example, in Figure 13.2.5 we see that thirteen is only writeable as \(3^2+2^2\) (or \(2^2+3^2\)).
We can confirm Proposition 13.2.4 visually in many cases, in that each of the circles with radius squared a prime either has no lattice points, or its only positive lattice points are \((a,b)\) and \((b,a)\) for one \(a\) and \(b\text{.}\)