When is $8x^2-4$ a square number? I asked an earlier question on when $32x+32$ is a square number (here) and I got a very clear answer.
Now I am looking to solve for which $x$ the equation $8x^2-4$ results in a square number. When I am trying to solve it I get: $y^2=4(2x^2-1)$ so if we put $y=2w$ then $2x^2-1 = w^2$ and therefore $x=\sqrt{\frac{w^2+1}{2}}$ which is correct.
Only now I need to check when $\frac{w^2-1}{2}$ is a square which goes on recursively. I am looking for Integer solutions for $x$ and $w$. How can I solve this?

As Daniel Fischer has said, you end up with $w^2 - 2x^2 = -1$, which is a negative Pell equation. I asked a question very similar earlier. The fundamental and minimal solution is $(w_1, x_1) = (1, 1)$. The rest of the solutions can be solved as convergents of the continued fraction of $\sqrt{2}$. The next solutions are described by the recurrence equations $w_{k+1} = 3w_k + 4x_k,\ x_{k+1} = 2w_k + 3x_k$. This resolves to $x_k = 6x_{k-1} - x_{k-2}$, with $x_0 = 0$. More information here.
