# Sums of squares (Proof) [duplicate]

Prove that $n^2 + (n + 1)^2 = m^3$ does not have solutions in the positive integers.

I guess that the proof is by contradiction, but if I suppose it, I can't find the contradiction.

• I made minimal progress that maybe someone else will better know how to work with (if it's useful at all). $m$ must be an odd number satisfying $n < \frac{m^3}{2} < n + 1$ – infinitylord May 31 '17 at 23:00
• @infinitylord How did you prove that? If $n<\frac{m^3}2<n+1$, I might be able to prove that only $n=0$ and $n=-1$ are solutions and answer the question. – AlgorithmsX May 31 '17 at 23:06
• If that's the case then you've proven it. If $m$ satisfies that inequality, then since $m^3$ would be odd, $m^3/2$ would be equal to $b+ \frac{1}{2}$ for some integer $b$. The inequality then gives $b=n$, so $m^3= 2n+1$. But then $2n^2=0$, so $n=0$. – M10687 May 31 '17 at 23:06
• I'm sorry, I was mistaken. I forgot to divide the middle inequality by $n+1$. The bound is then $n(n+1) < \frac{m^3}{2} < (n+1)^2$ which sadly is not nearly as nice. – infinitylord May 31 '17 at 23:24
• math.stackexchange.com/questions/1672211/… – guest Jun 1 '17 at 1:41

\begin{align} 2n^2+2n+1=m^3&\implies2n^2+2n=m^3-1\\ &\implies2n(n+1)=(m-1)(m^2+m+1)\\ &\implies m\equiv1\bmod4\\ &\implies2n(n+1)=4k((4k+1)^2+(4k+1)+1)\\ &\implies n(n+1)=32k^3+24k^2+6k\\ \end{align} For this to use only integers, $n=2ak$ or $2ak-1$. Substituting into the equation yields $$2a^2k\pm a=a(2ak\pm1)=16k^2+12k+3$$
• @infinitylord Actually, so did I. Apparently, $m\equiv1\bmod4\nrightarrow m^3\equiv1\bmod64$. – AlgorithmsX Jun 1 '17 at 0:27