sum of two consecutive squares that add up to a square Find all integer $x$ s.t. there is an integer $r$.
$x^2+(x+1)^2=r^2$
What if $x$ is a square?
All of my attempts lead to dead ends.
 A: If you know how to solve Pell's equation, then you are trying to solve:
$$(2x+1)^2-2r^2 = -1$$ which is a common variant of Pell's equation.
A: About the case where $x$ is square:
Following the standard solution to Pell's equation, the solution to this problem is given by the following recurrences: $$y_n = 2x_n + 1$$ $$y_0 = 1, y_1=7, y_{n+2}=6y_{n+1}-y_n$$ $$r_0 = 1,r_1=5, r_{n+2}=6r_{n+1}-r_n$$
So the problem is equivalent to finding out when $y_n-1$ is equal to twice a square.  $n=0$ is probably the only solution.  I suspect that this is a moderately hard but solvable problem—in principle it should be approximately as hard as finding all square Fibonacci numbers, which is very tricky to do with elementary methods.
A: Here's a series of reductions you may find helpful: 
Consider the more general problem of finding triplets of integers $(a,b,c)$ such that
$$a^2 + b^2 = c^2$$
It's know that if $a = m^2-n^2$and $b=2mn$ that in general
$$(m^2-n^2)^2 + (2mn)^2 = m^4+ 2m^2n^2 + n^4= (m^2+n^2)^2$$
Thus for every pair of integers $m,n$ we can generate a triple $a,b,c$ that satisfies this equation.
Now we are concerned with solutions such that $2mn = m^2-n^2 + 1$
A: 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$$ 
