<s>[INST] When can a sum of 3 identical squares be written as a sum of 3 non-identical squares? Consider $3n^2$ for some positive integer $n$. When do there exist positive integers $n_1,n_2,n_3$, not all equal to $n$, such that
$$
3n^2 = n_1^2 + n_2^2 + n_3^2
$$
An example is $27$:
$$
27 = 3^2 + 3^2 + 3^2 = 1^2 + 1^2 + 5^2
$$
 [/INST] I have one hint:
$(n-\alpha)^2 + (n- \alpha)^2 + (n+\alpha)^2 = n^2 -2n\alpha + \alpha^2 + n^2 -2n\alpha + \alpha^2 + n^2 +2n\alpha + \alpha^2 = \\ n^2 + n^2 + n^2 + 3\alpha^2 - 2n\alpha.$
So, if we want for the sum to have $3n^2$, then it is mandatory that we have $3\alpha^2-2n\alpha =0 \iff 3\alpha = 2n$, i.e. $\alpha = \frac{2n}{3}$.
Finally, the hint will work in a case when $n$ is divisible by $3$.
</s>