Section 13.1 Some First Ideas
Subsection 13.1.1 A first pattern
Let's assume you've done some exploration on your own. Here's a first pattern that you may have noticed, similarly to patterns in the past.
Fact 13.1.1.
If \(n\equiv 3\text{ (mod }4)\text{,}\) then \(n\) is not writeable as a sum of squares.
Proof.
You should be able to prove this pretty easily based on things you already know about squares modulo 4. (See Exercise 13.7.1)
The next thing to note is that Sage has a nice command to tell us an answer.
If a representation doesn't exist, we get an error. If it does, Sage returns two numbers \((a,b)\) such that \(a^2+b^2=\) your number.
In the next cell, I pick a number for which \(n\equiv 1\text{ (mod }4)\text{,}\) but this number cannot be written in this form. Thus Fact 13.1.1 doesn't just take care of all cases.
Fact 13.1.2.
There are positive integers with remainders \(0\text{,}\) \(1\text{,}\) and \(2\) when divided by four, but which are not representable as a sum of two squares.
Proof.
Show that \(12\text{,}\) \(21\text{,}\) and \(6\) are not. (See Exercise 13.7.2.)
You can use this interact to explore while avoiding the errors.
Sage note 13.1.3. Handling errors.
Most computer languages have a way to “handle” errors if we don't want to think of them as errors. In Python, this is the try
/except
syntax you see above. Basically, we are trying to use the two squares command, but if it hiccups, we instead just print a nice message.
Remark 13.1.4.
We have already addressed a very special case of writing numbers as a sum of squares. In fact, in Theorem 3.4.6 we saw a precise characterization of when a perfect square is a sum of two squares. We will mention this again briefly in Subsection 14.2.2.
Subsection 13.1.2 Geometry
Next, we can interpret this question very differently, relying on our geometric intuition. Figure 13.1.5 helps us visualize the problem.
In Figure 13.1.5, \(n=a^2+b^2\text{,}\) then \(n\) is the square of the radius of a circle which has \((a,b)\) as the coordinates of a point. So the sum of squares problem is actually a geometric one! Try it interactively below.
That is, we can rewrite Questions 13.0.1 and 13.0.5 like this.
Question 13.1.6.
Which circles around the origin do (or do not) have lattice points?
If a circle has lattice points, how many does it have?
We will choose to address these questions by connecting to geometry. There are many ways; for instance, in Section 20.1 we will connect to calculus ideas in number theory.
Subsection 13.1.3 Connections to some very old mathematics
The following identity was, separately, already known to Diophantus (remember Diophantine equations?) around 250, to Brahmagupta (about whom more in Section 15.6) around 600, and to Leonardo of Pisa (known also as Fibonacci) around 1250.
Fact 13.1.7. Brahmagupta-Fibonacci identity.
Proof.
Multiply and cancel; see Exercise 13.7.6.
This sort of identity may seem amazing to us, but to people used to needing lots of symbolic manipulation, it was just part of a toolkit by the time number theory began ascending with Fermat or Euler.
What is useful about this identity is that it implies the following.
Fact 13.1.8.
Products of numbers writeable as sums of squares can also be written as sums of squares!
Proof.
Use 13.1.7 above.
A final question for the reader is to ponder why this means that we can really reduce the question to whether primes are writeable as a sum of squares.