Exercise 1. Determine all triplets $(x, y, z)$ of integers such that

$$
x^{2}+y^{2}+z^{2}=16(x+y+z)
$$
Solution to Exercise 1 First, note that the equation can be rewritten as

$$
x(x-16)+y(y-16)+z(z-16)=0
$$

This suggests a change of variables, setting $X=x-8, Y=y-8$ and $Z=z-8$. The equation then becomes

$$
X^{2}+Y^{2}+Z^{2}=3 \times 8^{2}
$$

We then introduce the following lemma on sums of three squares: if $\mathrm{a}, \mathrm{b}$ and $\mathrm{c}$ are three integers such that $\mathrm{a}^{2}+\mathrm{b}^{2}+\mathrm{c}^{2} \equiv 0(\bmod 4)$, then $\mathrm{a}, \mathrm{b}$ and $\mathrm{c}$ are all even. Indeed, the square of an even integer is $0(\bmod 4)$, and the square of an odd integer is $1(\bmod 4)$.

By applying the lemma three times, we show that $X, Y$ and $Z$ are multiples of 8. Once again, we change variables, setting $u=\frac{x}{8}=\frac{x}{8}-1, v=\frac{Y}{8}=\frac{y}{8}-1$ and $w=\frac{z}{8}=\frac{z}{8}-1$. The equation becomes

$$
u^{2}+v^{2}+w^{2}=3
$$

It is then clear that $(\mathfrak{u}, v, w)$ is a solution if and only if $\mathfrak{u}^{2}=v^{2}=w^{2}=1$, that is, if and only if $u, v$ and $w$ all belong to the set $\{-1,1\}$. The initial equation therefore has solutions in the form of triplets $(x, y, z)$ such that $x, y$ and $z$ all belong to the set $\{0,16\}$.