<s>[INST] Show that there are no solutions to $x^2 + y^2 = 3z^2$ in $\Bbb{Z}$ I'm attempting to work through some of the questions in Whitelaw's "Introduction to Abstract Algebra" but am having some difficulty.
The question is as follows

Show that $\forall n \in \Bbb{Z},$ $n^2 \equiv 0\  \text{or}\  1 \mod{3}.$ Show further that $$3\rvert(x^2 + y^2) \implies 3\rvert x\ \text{and}\ 3\rvert y.$$
  Deduce that there is no solution in $\Bbb{Z}$ to the equation
  $$x^2 + y^2 = 3z^2$$ 
  except $x = y = z = 0.$

For the first part, I simply let $n = 3k,$ $3k+1$ or $3k + 2$ with $k \in \Bbb{Z}$. Hence, 
\begin{align}
(3k)^2 &\equiv 0 \mod{3}\\
(3k+1)^2 = 9k^2 + 6k + 1 &\equiv 1\mod{3}\\
(3k+2)^2 = 9k^2 + 12k + 3 + 1 &\equiv 1\mod{3}.
\end{align}
For the second part, since $n^2 \equiv 0$ or $1 \mod{3}$, and that the only case in which $n^2 \equiv 0 \mod{3}$ was when $3\rvert n$, it must then be the case that both $x^2$ and $y^2$ are divisible by $3$ for $3$ to divide their sum (else we get that $x^2 + y^2 \equiv 1$ or $2 \mod{3}$). We also know that if $3\rvert n$ then $3\rvert n^2$. Hence, $3\rvert x$ and $3\rvert y$.
I am, however, unsure how to approach the third part.
Thanks for any help!
 [/INST] Let's suppose that we have a solution $(a,b,c)$ where $c\neq 0$ is the smallest positive integer such that the equality holds.
$$a^2 + b^2= 3c^2 \Rightarrow 3|(a^2 + b^2)$$
But we know that this means $3|a$ and $3|b$. However, on squaring we get that $9$ divides the LHS, and so it must also divide the RHS:
$$a'^2 + b'^2 = \frac{c^2}{3}$$
Where $3a' = a, 3b' = b$. But $3$ is prime, so if it divides the product it must divide $c$. Factor that out as $3c'$ and divide:
$$a'^2 + b'^2 = 3c'^2$$
But this is another solution triple with $c' < c$ (and also $c' \neq 0$), and we chose the smallest possible $c$, so we have a contradiction.
</s>