Skip to main content
Logo image

Exercises 13.7 Exercises


Prove that if \(n\equiv 3\text{ (mod }4)\text{,}\) then \(n\) cannot be written as a sum of two squares (13.1.1).


Show that if \(n\equiv 7\text{ (mod }8\text{)}\text{,}\) then \(n\) cannot be written as a sum of three perfect squares. (See also Exercise 14.4.6.)


Find two numbers that can be written as a sum of three squares in two essentially different ways (not just \(1^2+0^2+0^2=0^2+1^2+0^2\) or even \(3^2 + 4^2 +1^2 = 0^2 + 5^2 + 1^2\)). (See also Exercise 14.4.4.)


Find as many integers \(n\) as possible which are only writeable as a sum of squares via \(n=a^2+a^2=2a^2\text{,}\) i.e. \(n\) is not writeable as a sum of distinct squares.


Verify Fact 13.1.7 by hand (i.e. write all the algebra out).


Let \(r_2(n)\) be the number of different ways to write \(n\geq 0\) as a sum of two squares, where every different way (not just essentially different) is counted. For instance,
\begin{equation*} r_2(2)=4\text{ because }(-1,1),(-1,-1),(1,1),(1,-1)\text{ all work.} \end{equation*}
Prove that
\begin{equation*} r_2\left(2^m\right)=4\text{ for all }m\geq 1\text{.} \end{equation*}

Exercise Group.

Let \(N\) be odd, and let \(N=a^2+b^2\) and \(N=c^2+d^2\text{,}\) where the pairs \((a,b)\) and \((c,d)\) are both positive and not the same or just switched in order. Verify the following to finish the proof of Fact 13.2.1.


It’s okay to assume that \(a\) and \(c\) are odd and \(b\) and \(d\) are even, with \(a\geq c\) and \(d\geq b\text{.}\)


If this is the case, show that \(k=\gcd(a-c,d-b)\) and \(n=\gcd(a+c,d+b)\) are both even.


Assuming the previous two exercises, show that \(\frac{a-c}{k}=\frac{d+b}{n}\) and \(\frac{d-b}{k}=\frac{a+c}{n}\text{.}\)


Assuming everything else works, show that \(N\) is in fact the product of the terms in question; this will involve a fair amount of cancellation!


Using the tools of this chapter, for each of the numbers \(5095\text{,}\) \(5096\text{,}\) \(5097\text{,}\) \(5098\text{,}\) and \(5099\text{,}\) either write it as a sum of two perfect squares or explain why it is impossible to do so.

Exercise Group.

Pick four random (to you) three digit numbers which are not of the form \(4k+3\text{.}\)


Decide whether these numbers are a sum of two squares without using Sage.


Pick two of those numbers and write them in all possible ways as a sum of two squares.


Show a positive integer \(k\) is the difference of two squares if and only if \(k\not \equiv 2\) (mod \(4\)).


Prove that if \(n\equiv 12\) (mod \(16\)), then \(n\) cannot be written as a sum of two squares.


Is there any congruence condition modulo \(6\) for which a number cannot be written as a sum of two squares?


Referring to the proof of the main theorem (especially in Subsection 13.4.3): Check that the pictures you get from some other primes with these lattices really work.

Exercise Group.

Check every piece of the Zagier proof (Proposition 13.6.1).


The set \(S\) is finite. Try figuring out what \(S\) is for \(p=5\) or \(p=13\text{,}\) the smallest such primes.


Each \((x,y,z)\) has exactly one of the three things to go to.


The function in question is an involution. That is, if you take the output and apply the function a second time, you get your original \((x,y,z)\) back (this is a little tougher).


If \((x,y,z)\) goes to \((x,y,z)\) then it turns out that \((x,y,z)=(1,1,\frac{p-1}{4})\) (you will probably need to use the definition of \(S\) for this, and remember that we assume \(p\equiv 1\) (mod \(4)\)).


That if the map \((x,y,z)\to (x,z,y)\) has a point which is fixed (the output is same as input) then this, combined with the definition of \(S\text{,}\) means that \(p\) is writeable as the sum of two squares.


Prove the assertion about \(\pm \left(\frac{p-1}{2}\right)!\) in Remark 13.3.4.