If $n-1$ and $n+1$ are both primes, establish that the integer $2n^2+2$ can be represented as the sum of 2, 3, 4, and 5 squares.
I managed to solve 2 and 4 squares, since: $$2n^2+2 = (n+1)^2+(1-n)^2= n^2+n^2+1^2+1^2.$$
For 3 squares I thought the following. I do know that a positive integer can be represented as the sum of 3 squares if it is not of the form $4^n(8m+7)$. Since $n$ is even, $2n^2+2$ can be written as $8k^2+2$, which is not of the form $4^n(8m+7)$, so it can be represented as a sum of three squares.
Now I only need to prove the 5 squares part, but I don't know where to start. Any hints? Thank you in advance.