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?
 A: 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.
A: Note that these squares form a primitive Pythagorean Triplet, so there exist integers (p) and (q) such that $\(n = p^2 - q^2\)$ and $\(n+1 = 2pq\)$ (or the other way around). Thus, (p^2 - q^2 = 2pq \pm 1 \implies $(p-q)^2 + 2q^2 = \pm 1\).$
Let $\(u=p-q\)$, and $\(v=q\)$, so we have the Pell equations $\(u^2 - 2v^2 = 1\)$ and $\(u^2 - 2v^2 = -1\).$
$[b]Part 1:[/b] \(u^2 - 2v^2 = 1\)$
The fundamental solution of this can be observed as being ((3, 2)). Thus, using the recursive formula $\((u_{n+1}, v_{n+1}) = (u_0  u_n + D v_0 v_n, u_0 v_n + v_0 u_n)\)$, we get the following solutions: ((3, 2), (17, 12), (99, 49), \ldots). These give the respective values for ((p,q)): ((5, 2), (29, 12), (148, 49), \ldots), which respectively give these values for (n): (n=20, 696, 7252, \ldots). Thus, all satisfying (n<200) in this case is only (n=20).
$[b]Part 2:[/b] \(u^2 - 2v^2 = -1\)$
The fundamental solution for this can be observed as being ((1, 1)). Thus, using the recursive formula ((u_{n+1}, v_{n+1}) = (u'_0  u_n + D v'_0 v_n, u'_0 v_n + v'_0 u_n)), where ((u'_0, v'_0)) is the fundamental solution of (u^2 - 2v^2 = 1), we get the following solutions: ((1, 1), (7, 5), (41, 29), \ldots). These give the respective values for ((p,q)): ((2, 1), (12, 5), (70, 29), \ldots), which respectively give these values for (n): (n=3, 119, 4059, \ldots). Thus, all satisfying (n<200) in this case are (n=3, 119).
Thus, we have all satisfying values of (n) to be (3, 20, 119).

I believe another solution can be attained by Vieta Root Jumping for ((p, q)), as can be noticed by the combinations ((2, 1), (5, 2), (12, 5), (29, 12), (70, 29), \ldots).[/quote]
