Sum of squares of integers divisible by 3 Suppose that $n$ is a sum of squares of three integers divisible by $3$. Prove that it is also a sum of squares of three integers not divisible by $3$.
From the condition, $n=(3a)^2+(3b)^2+(3c)^2=9(a^2+b^2+c^2)$. As long as the three numbers inside are divisible by $3$, we can keep pulling out a factor of $9$, until we get $n=9^k(x^2+y^2+z^2)$. Modulo $3$, squares leave a remainder of either $0$ or $1$. Therefore one or three of $x,y,z$ are divisible by $3$.
 A: Let $n=(3x_1)^2+(3x_2)^2+(3x_3)^2$. Then
$$n=(2x_1+2x_2-x_3)^2+(2x_2+2x_3-x_1)^2+(2x_3+2x_1-x_2)^2\;,$$
and the $x_i$ can independently be chosen with either sign.
Let $k$ be the lowest exponent of $3$ in the $x_i$, and write $x_i=3^k(3a_i+r_i)$ with $0\le r_i\lt3$. By construction, at least one of the $r_i$ is non-zero. If only one is non-zero, all sums contain exactly $k$ factors of $3$. If two are non-zero, choose the signs so that $r=(0,1,1)$, and if all three are nonzero, choose the signs so that $r=(1,1,2)$. In all cases, all three sums contain exactly $k$ factors of $3$, and thus at least one less than before. The result then follows by induction.
A: Induction on the power of $9$ dividing the number. Begin with any number not divisible by $9,$ although it is allowed to be divisible by $3.$ The hypothesis at this stage is just that this number is the sum of three squares, say $n = a^2 + b^2 + c^2.$ Since this $n$ is not divisible by $9,$ it follows that at least one of $a,b,c$ is not divisible by $3.$ Let us order so that we can demand $c$ not divisible by $3.$ If $a+b+c$ is divisible by $3,$ replace it by $-c$ and use the same name. We now have 
$$ a + b + c \neq 0 \pmod 3. $$
Induction: let $n = a^2 + b^2 + c^2,$ with $a+b+c \neq 0 \pmod 3.$ Then
$$  9n = (a-2b-2c)^2 + (-2a+b-2c)^2 + (-2a-2b+c)^2,  $$
where all three summands are nonzero $\pmod 3.$ We can multiply by another $9,$ then another, and so on. 
The formula is $- \bar{q} p q $ in the quaternions with rational integer coefficients, where $q=i+j+k$ and $p= ai+bj+ck.$ 
