7. let $n \geq 1$ be a natural number. Determine all positive integer solutions of the equation

$$
7 \cdot 4^{n}=a^{2}+b^{2}+c^{2}+d^{2}
$$

## Solution
Let $n \geq 2$ be first. Then the left-hand side is divisible by 8, so is the right-hand side. In particular, $a, b, c, d$ are all even, all odd or exactly two of them even and two odd. Consider the equation modulo 8. The only quadratic remainders $(\bmod 8)$ are $0,1,4$. If $a, b, c, d$ were all odd, then $a^{2}+b^{2}+c^{2}+d^{2} \equiv 4 \not \equiv 0$. If there were exactly two even and two odd, then $a^{2}+b^{2}+c^{2}+d^{2} \equiv 2 \not \equiv 0$. Consequently, $a, b, c, d$ are even and we can write $a=2 a_{1}, b=2 b_{1}, c=2 c_{1}$ and $d=2 d_{1}$. Here, $\left(a_{1}, b_{1}, c_{1}, d_{1}\right)$ is a positive integer solution of the original equation, where $n$ is replaced by $n-1$. Inductively, it follows that $a=2^{n-1} x, b=2^{n-1} y, c=$ $2^{n-1} z, d=2^{n-1} w$, with $28=x^{2}+y^{2}+z^{2}+w^{2}$. You can easily calculate that
$(5,1,1,1),(4,2,2,2)$ and $(3,3,3,1)$ are the only solutions to this equation except for permutation. Consequently, the solutions we are looking for are the permutations of

$$
\left(5 \cdot 2^{n-1}, 2^{n-1}, 2^{n-1}, 2^{n-1}\right), \quad\left(2^{n+1}, 2^{n}, 2^{n}, 2^{n}\right) \quad \text { and } \quad\left(3 \cdot 2^{n-1}, 3 \cdot 2^{n-1}, 3 \cdot 2^{n-1}, 2^{n-1}\right)
$$