# Prove that the diophantine equation $x^2 + (x+1)^2 = y^2$ has infinitely many solutions in positive integers.

Prove that the diophantine equation $x^2 + (x+1)^2 = y^2$ has infinitely many solutions in positive integers.

Now, that's a Pythagorean Triplet. So, we have to prove that there are infinitely many solutions to it. I have found a few: $(x, x+1, y) = (0, 1, 1), (3, 4, 5), (20, 21, 29), (119, 120, 169), (696, 697, 985)$. I wrote a script to calculate solutions till ten million and there are only $9$ of them. Also, they alternate between even and odd $x$ though the $y$ is always odd. Somehow the $x$ turns out to be a little less than the previous $x$ times $6$.

Thanks.

• Is it known there are infinitely many? Or is it a conjecture? – N.S.JOHN May 28 '16 at 15:58
• @N.S.JOHN It's a problem on the problem set and, hence, I believe is true. – TheRandomGuy May 28 '16 at 15:59
• The solution to this problem in a General way. There. artofproblemsolving.com/community/c3046h1049346__2 – individ May 28 '16 at 16:41
• @individ Many, many thanks. – TheRandomGuy May 28 '16 at 16:48

Let $z=2x+1$. The original equation is equivalent to: $$z^2-2y^2 = -1$$ that is a standard Pell's equation with solutions given by the units of $\mathbb{Z}[\sqrt{2}]$ - have a look at Pell numbers. For instance, the norm of $1+\sqrt{2}$ in $\mathbb{Z}[\sqrt{2}]$ is $(1+\sqrt{2})(1-\sqrt{2})=-1$, so the same applies to any odd power of $(1+\sqrt{2})$. That gives that the sequence: $$z_0=1,\quad z_1=7,\quad z_{n+2}=6z_{n+1}-z_{n}$$ provides an infinite number of solutions, coupled with: $$y_0=1,\quad y_1=5,\quad y_{n+2}=6y_{n+1}-y_n,$$ since the minimal polynomial of $(1+\sqrt{2})^2$ is exactly $x^2-6x+1$.
First of all, we have that $2n^2 - 1 = k^2$ has infinitely many solutions (I am still not able to prove this. Can anyone help me with this?).
Now, choose $x = \frac{k-1}{2}$, $x + 1 = \frac{k+1}{2}$ and $y = n$ (since $k$ is odd). This is a solution to the Diophantine Equation.
$${{\left( {{\left( b\pm\sqrt{2{{b}^{2}}-1}\right) }^{2}}-{{b}^{2}}\right) }^{2}}+4{{b}^{2}}\,{{\left( b\pm\sqrt{2{{b}^{2}}-1}\right) }^{2}}={{\left( {{\left( b\pm\sqrt{2{{b}^{2}}-1}\right) }^{2}}+{{b}^{2}}\right) }^{2}}$$ $${{b}_{n}}=\sum_{k=0}^{n}{\left. {{2}^{k+\operatorname{floor}\left( \frac{k}{2}\right) }}\,{{3}^{n-k}}\,\begin{pmatrix}n\\ k\end{pmatrix}\right.}$$
or $${{\left( {{\left( b\pm\sqrt{2{{b}^{2}}+1}\right) }^{2}}-{{b}^{2}}\right) }^{2}}+4{{b}^{2}}\,{{\left( b\pm\sqrt{2{{b}^{2}}+1}\right) }^{2}}={{\left( {{\left( b\pm\sqrt{2{{b}^{2}}+1}\right) }^{2}}+{{b}^{2}}\right) }^{2}}$$ $${{b}_{n}}=\sum_{k=0}^{n}{\left. \left( \operatorname{ceiling}\left( \frac{k}{2}\right) -\operatorname{floor}\left( \frac{k}{2}\right) \right) \,{{2}^{k+\operatorname{floor}\left( \frac{k}{2}\right) }}\,{{3}^{n-k}}\,\begin{pmatrix}n\\ k\end{pmatrix}\right.}$$