Legendre's three-square theorem Problem:
If $ n \in \mathbb{N} $ can be represented as $ n = n_1^2 + n_2^2 + n_3^2 ,\quad n_1, n_2, n_3 \in \mathbb{Z}, $ show that then $ n \neq 4^a(8m+7)$ for $a,m \in \mathbb{Z}.$
My solution:
Since this is the beginning of a math course in Discrete Mathematics, I don't think we're supposed to use the quadratic reciprocity law, Dirichlet's theorem on arithmetic progressions nor the equivalence class of the trivial ternary quadratic form. as listed on Wikipedia.
It also states on Wikipedia (Why?) that every square is congruent to either $0,1,4$ in $\mathbb{Z}_8$. So the sum of three squares $n \in \{0,1,2,3,4,5, 6\} \subset \mathbb{Z}_8.$ My initial plan was to show that $ 4^a(8m+7) \in \{6,7\}$. This not true though, as $ 4^a \equiv 4 $ or $ \equiv 0 $ for $ a \geq 1 $. Thus $ 4^a(8m+7) \equiv 0 $ or $4$.
Any hints?
Muchos gracias!
 A: Well as the equation $$n=n^2_1+n^2_2+n^2_3$$ has no integral solutions if $n$ is of the form $n=8m+7$ for some integer $m$--established in the comments, we can prove that the equation
$$n=n^2_1+n^2_2+n^2_3$$ has no integral solutions if $n$ is of the form $n=4^a(8m+7)$ for some integers $m, a \ge 1$, by induction on $a$.
[To elaborate, as shown, there are no solutions to  $$n=n^2_1+n^2_2+n^2_3$$ for $n$ of the form $n=8m+7$ i.e., $a=0$. So fix an $a >0$. We show that if there is a solution to $$n=n^2_1+n^2_2+n^2_3$$ for any $n$ of the form $n=4^a(8m+7)$, then there must be a solution to $$\tilde{n}=\tilde{n}^2_1+\tilde{n}^2_2+\tilde{n}^2_3$$ for some $\tilde{n}$ of the form $\tilde{n}=4^{a-1}(8m+7)$. As it has already been established in the comments that there is no solution to $$\tilde{n}=\tilde{n}^2_1+\tilde{n}^2_2+\tilde{n}^2_3$$ for some $\tilde{n}$ of the form $\tilde{n}=(8m+7) =4^0(8m+7)$ this establishes the desired result.]
The crux of the proof is this: Suppose $n = 4^a(8m+7)$ for $a \ge 1$. Then $n \mod 4 = 0$ and as every even square is $0 \mod 4$ and every odd square is $1 \mod 4$ [check this for yourself] it follows that $n_1,n_2,n_3$ must all be even. So then this implies
$$\frac{n}{4} = \left(\frac{n_1}{2}\right)^2 +\left(\frac{n_2}{2}\right)^2 +\left(\frac{n_3}{2}\right)^2$$ must hold, with the $\left(\frac{n_i}{2}\right)$s; $i=1,2,3$ all integers and with $\frac{n}{4} = 4^{a-1}(8m+7)$.
