I am looking for integer pairs $(x,y)$ that respect $$2x^2 = y^2 + y$$
For example $(6,8)$ is a solution for that. Simple solution is to enumerate on $x$ or $y$ and test if the corresponding variable is an integer. However, I am searching for number too big to enumerate and test (just takes too long). By enumerating, I noticed that the values for $x$ increase by a factor around $5$ or $6$ every solution. This pattern I see with the first $17$ solutions, but I cannot figure out how to describe that pattern. Solution number $17$ took $8$ hours computation since solution $16$, and computation time increases by the same factor $5$ or $6$, so finding solution 18 or further is not doable by just enumerating.
Is there a way to predict where the next integer pair will be?
Thanks
You are looking for solutions to Pell's equation: If you multiply both sides of $2x^2=y^2+y$ by $4$, you can rewrite it as
$$8x^2=(2y+1)^2-1$$
which can be rewritten as
$$u^2-8x^2=1$$
with $u=2y+1$. The "fundamental solution" is $(u+x\sqrt8)(u-x\sqrt8)=(3+\sqrt8)(3-\sqrt8)$, and all other solutions are expansions of $(3+\sqrt8)^n$. For example $(3+\sqrt8)^2=17+6\sqrt8$ gives $x=6$ and $u=17$, which corresponds to $y=8$. Once you've computed $(3+\sqrt8)^n$ as $u_n+x_n\sqrt8$, you can get $(u_{n+1},x_{n+1})$ from $u_{n+1}+x_{n+1}\sqrt8=(3+\sqrt8)(u_n+x_n\sqrt8)=(3u_n+8x_n)+(u_n+3x_n)\sqrt8$.
Remark: I should have noted that this procedure produces the solutions with positive values of $u$ and $x$. You can, or course, stick a negative sign in front of either variable. Finally, if $x=0$, there are the two solutions, $u=1$ and $u=-1$, corresponding to $y=0$ and $=-1$.