# Find all $x$ for that $x^2 + (x+1)^2$ is a square

How to find all natural $x$ for that $x^2 + (x+1)^2$ is a perfect square?

-
Suppose $x^2 + (x+1)^2 = y^2$. We can rewrite it as $(2x+1)^2 + 1 = 2y^2$ or $(2x+1)^2 - 2y^2 = -1$.
If $z=2x+1$ then we have $z^2 - 2y^2 = -1$. This is Pell's equation. Wikipedia article shows how to solve it.