# $k^{2}+(k+1)^{2}$ being a perfect square for infinitely many $k$

Generally one can see that there are infinite number of solutions for this equation $$a^{2}+b^{2}=c^{2}$$ by taking multiples of the solution $3,4$ and $5$.

Can i use this as a fact to prove, that $k^{2} + (k+1)^{2}$ is a perfect square for infinitely many $k \in \mathbb{N}$? Any hints, suggestions would be helpful. If not, then how do i prove this fact!

-

You can find infinitely many by considering solutions of Pell's equation $m^2 - 2a^2=-1.$ Your (3,4,5) solution comes from$$(7-5\sqrt{2})(7+5\sqrt{2})=-1,$$ where $m=7$ and $a=5$. For example $$(7-5\sqrt{2})^3$$ yields $$696^2+697^2 = 985^2.$$

Just to make it a bit more clear note that $$\left( {m-1 \over 2} \right)^2 + \left( {m+1 \over 2} \right)^2 = a^2.$$

-

This is obvious by ascent in the ternary tree of Pythagorean triples. Explicitly, ascent yields this formula:

$\rm (x,x+1,z) \to (X,X+1,Z),\ \ X = 3x+2z+1,\ \ Z = 4x+3z+2\:.\ \$ For example

$\rm (3,4,5)\to (20, 21, 29)\to (119, 120, 169)\to (696, 697, 985)\to (4059, 4060, 5741)\to\cdots$

This corresponds to always taking the middle branch in the tree, see below
The reflection that yields the descent in the triples tree is the following

$\quad\quad (x,y,z)\; \mapsto (x,y,z) - 2 \dfrac{(x,y,z)\cdot(1,1,1)}{(1,1,1)\cdot(1,1,1)} (1,1,1)$

$\quad\quad\quad\quad\quad\quad = (x,y,z) - 2 \; (x+y-z) \; (1,1,1)$

$\quad\quad\quad\quad\quad\quad = (-x-2y+2z, \; -2x-y+2z, \; -2x-2y+3z)$

We ascend the tree by inverting this reflection, combined with trivial sign-changing reflections:

$\quad\quad (-3,+4,5) \mapsto (-3,+4,5) - 2 \; (-3+4-5) \; (1,1,1) = ( 5,12,13)$

$\quad\quad (-3,-4,5) \mapsto (-3,-4,5) - 2 \; (-3-4-5) \; (1,1,1) = (21,20,29)$

$\quad\quad (+3,-4,5) \mapsto (+3,-4,5) - 2 \; (+3-4-5) \; (1,1,1) = (15,8,17)$

Continuing in this way enables one to reflectively generate the entire tree of primitive Pythagorean triples. This has a beautiful geometric interpretation in terms of refelections - see my said MathOverflow post and see here for sums of four squares.

-

Pell's equation becomes essential in getting all the solutions to $$k^2 + (k+1)^2 = j^2$$.

Since $gcd(k,k+1) =1$ we may assume that (by the formula for all primitive pythagorean triples) that

$$m^2 - n^2 = 2mn \pm 1$$

This is a quadratic in $m$ and solving for $m$ gives us

$$m = n \pm \sqrt{2n^2 \pm 1}$$

Thus any solution of $$k^2 + (k+1)^2 = j^2$$ can be used to get a solution to the equation $$2n^2 \pm 1 = b^2$$ and vice versa.

-

It is clear that there is a relationship with solutions of Pell's equation, but it must still be written more clearly and in a more general way.

Solutions of the equation: $X^2+(X\pm{a})^2=Y^2$

Defined solutions of Pell's equation: $p^2-2s^2=\pm{a}$

And the solutions are of the form:

$X=2s(s+p)$

$Y=2s(s+p)+p^2$

These numbers can be different characters.

I almost forgot. If we know what the solution of Pell's equation $p^2-2s^2=a$

$s_{2}=2p+3s$

$p_{2}=3p+4s$

-