Exercise 619Number theory › CongruencesOlympiadAdded 4 Nov 2026
8k + 7 is not a sum of three squares
#squares modulo 8#representation by squares
Statement
Prove that no integer of the form is a sum of three squares of integers.
Hint
What are the possible values of a square modulo ?
Show solutionHide solution
Solution
Squares modulo 8. For odd, ; for , ; for , . So squares are modulo .
Sums of three. The sums of three elements of are:
Precisely, the possible sums are the residues modulo . The residue is never obtained (for instance , , ).
Conclusion. No sum of three squares is .
Remark. Legendre's three-square theorem states the converse: a positive integer is a sum of three squares iff it is not of the form . For example , , are not sums of three squares.
Lesson. List the residues of squares modulo () and check which sums are attainable: the standard way to rule out representations.