How to show that if $9n^2=a^2+b^2$, $a$ and $b$ are multiples of $3$ To be honest, I don't know where to start with this problem:
Let $n\in \mathbb{N}$. Prove that if $9n^2$ is the sum of two perfect squares $(a^2,b^2)$, then $a$ and $b$ are multiples of $3$.

If one of them is not, say wlog $ a $, then $ a^2 + b^2 \equiv 0 \pmod{9} $, and $ (b/a)^2 \equiv -1 \pmod{9} $ so that $ b/a $ has order $ 4 $ in the group $ (\mathbf Z/9 \mathbf Z)^{\times} $ of order $ 6 $, contradicting Lagrange's theorem.
