<s>[INST] Show that $23a^2$ is not the sum of 3 squares. I know that Legendre's theorem states that a number is expressible as a sum of 3 squares iff. it's not of the form $4^x (8m+7)$, so I need to show that $23a^2$ is of this form, how could I go about doing this? 
 [/INST] If a number $n$ is of this form, then:
$$n = 4^x \left(8m + 7\right) = 4^x \cdot 8m + 7 \cdot 4^x = 23a^2$$
Therefore
$$n \equiv 7 \cdot 4^x \equiv \begin{cases}0 & \text{if } x > 1 \\4 & \text{if } x = 1\\7 & \text{if } x = 0\end{cases}\pmod{8}$$
and
$$n \equiv 23 a^2 \equiv \begin{cases}0 & \text{if } a \equiv 0 \pmod{4}\\4 & \text{if } a \equiv 2 \pmod{4}\\7 & \text{if } a \text{ is odd}\end{cases}\pmod{8}$$
Lets bust the case where $n \equiv 7 \pmod{8}$. It means that $a$ is odd. So $23a^2$ is odd, too. However $4^x \left(8m + 7\right)$ is even. Because $n$ can't be even and odd at the same time, it is a contradiction.
Next case: $n \equiv 4 \pmod{8}$
$$4 \left(8m + 7\right) = 23a^2 \quad a \in \{2,6,10,12,...\}$$
Because $\left(8m + 7\right)$ is not divisible by $4$, $a$ needs to be $2$, then:
$$8m + 7 = 23$$
Therefore $m = 2$.
So actually it is of the form!
$$4^1 \left( 8 \cdot 2 + 7 \right) = 23 \cdot 2^2$$
One possible solution: $x = 1$, $m = 2$, $a = 2$
</s>