Challenge Level

Show that every odd square leaves remainder $1$ when divided by $8$, and that every even square leaves remainder $0$ or $4$.

Deduce that a number of the form $8n+7,$ where $n$ is a positive integer, cannot be expressed as a sum of three squares.

*STEP Mathematics III, Specimen paper, Q10(i). Question reproduced by kind permission of Cambridge Assessment Group Archives. The question remains Copyright University of Cambridge Local Examinations Syndicate ("UCLES"), All rights reserved.*