Skip to main content
\( \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Section13.2Primes Can Be Written in at Most One Way

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 in 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 as writing a number as a sum of squares in two essentially different ways. Compare \begin{equation*}13=3^2+2^2=2^2+3^2\end{equation*} to the situation \begin{equation*}25=5^2+0^2=3^2+4^2\end{equation*} We say the latter ways are essentially different. Now we see how to

Example13.2.2

For \(N=25\), what are \(a,b,c,d\)?

Then \(k=\gcd(2,4)=2\), \(n=\gcd(8,4)=4\) which means \(\ell=1\) and \(m=2\), yielding \begin{equation*}25=\left[\left(\frac{2}{2}\right)^2+\left(\frac{4}{2}\right)^2\right]\left(1^2+2^2\right)=5\cdot 5\end{equation*}

And so \(25\) is a product of numbers themselves writeable as a sum of two squares.

It is now nearly trivial to prove the following.

We can see this visually below, in that each of the circles with radius square root a prime either has no lattice points, or has only positive lattice points that are \((a,b)\) and \((b,a)\) for one \(a\) and \(b\).