Sum of squares of 3 consecutive numbers is not a perfect square

modular arithmeticsquare-numbers

I'm trying to show that $(n-1)^2+n^2+(n+1)^2=a^2$ does not have a solution for $n,a\in \Bbb N$. I've written $(n-1)^2+n^2+(n+1)^2=3n^2+2$, so what I need to show is that $3n^2+2$ cannot be a perfect square. From here and here I understand that there is some relationship between perfect squares and modulo, but I fail to see which is it or how should apply it in my case. I do understand, however, that, in the case of 5 consecutive numbers, $n^2+2$ needs to be a multiple of 5.

Best Answer

You are nearly there. Now just use the fact that $a^2 \ne 2 \pmod 3$.

The proof is here, which relies on the fact that you can just check $n=0,1,2$ (or even better, $n=-1,0,1$) for a result that holds for all natural $n$.

Related Question