Show that $x^2+y^2+z^2=999$ has no integer solutions 
The question is asking us to prove that $x^2+y^2+z^2=999$ has no integer solutions. 

Attempt at a solution: 
So I've noticed that since 999 is odd, either one of the variables or all three of the variables must be odd. 
If I assume that only one variable is odd, I can label the variables like this: 
$$x=2k_1+1$$
$$y=2k_2$$
$$z=2k_3$$
By substituting, and doing some algebra, I can conclude that $k_1^2+k_2^2+k_3^2+k_1=249.5$, which is not possible since all $k_i\in\Bbb Z$.
If all three are odd, I can rename the variables like this: 
$$x=2k_1+1$$
$$y=2k_2+1$$
$$z=2k_3+1$$
Eventually I conclude that $k_1^2+k_2^2+k_3^2+k_1+k_2+k_3 = 249$, but I don't know where to go from there. 
An alternative I've considered is brute-forcing it, but I'd rather avoid that if I can. Any assistance here would be greatly appreciated. 
 A: My immediate solution was the same as Jorge Fernández Hidalgo, using $\bmod 8$ limits, but carrying on from your sticking point (and trusting your work to that point):
$$k_1^2+k_2^2+k_3^2+k_1+k_2+k_3 = 249 \\
(k_1^2+k_1) + (k_2^2+k_2)+(k_3^2+k_3) = 249 \\
k_1(k_1+1) + k_2(k_2+1)+k_3(k_3+1) = 249 \\
$$
and we have three even terms summing to an odd number, which cannot therefore exist.
A: This is impossible because the number is congruent to $-1\bmod 8$.
Notice that squares are only $1,4$ and $0\bmod 8$.

In fact there is a theorem by Legendre that say that a number is not the sum of three squares if and only if it is of the form $4^a(8b-1)$. (the other direction is the tough one).
A: Using congruences . . .
Odd squares are always $1 \pmod 8$, hence also $1 \pmod 4$.

Even squares are always $0 \pmod 4$, hence either $0 \text{ or } 4 \pmod 8$.

Since $x^2 + y^2 + z^2$ is odd, either $x,y,z$ are all odd, or exactly one of $x,y,z$ is odd.

If $x,y,z$ are all odd, then $x^2 + y^2 + z^2 \equiv 3 \pmod 8$, contradiction, since $999 \equiv 7 \pmod 8$.

If exactly one of $x,y,z$ is odd, then $x^2 + y^2 + z^2 \equiv 1 \pmod 4$,
contradiction, since $999 \equiv 3 \pmod 4$.
