[Math] Show that if $n\equiv 3, 6 \pmod9 $ then $n$ is not a sum of two squares

elementary-number-theorymodular arithmeticsums-of-squares

Show that if $n\equiv 3, 6 \pmod9 $ then $n$ is not a sum of two squares.

I started by: Assume $n=a^2+b^2$ a sum of two squares. Then $a^2,b^2\equiv 0,1,4,7 \pmod9$, and no combination these numbers can yield $3$ or $6$ so that $a^2+b^2\equiv 3,6 \pmod9$.

But then I would need to show the first result, but I don't know any results (and shouldn't need to apply) results for quadratic residues modulo a composite number. Otherwise, maybe I need to use the result that $n$ is a sum of two squares if $n \not\equiv 3\pmod4$.

Best Answer

$$x^2 \equiv 0, 1, 4, 7 \pmod 9$$

Thus, sum of two squares can only be $0, 1, 2, 4, 5, 7, 8 \pmod 9$.

Hence, numbers $\equiv 3, 6 \pmod 9$ are not expressible as the sum of 2 squares.

Related Question