Recurrence relation solution to negative Pell’s equation

discrete mathematicspell-type-equationsrecurrence-relations

I'm trying to determine how to get the sequence of possible solutions for a negative Pell's equation:
$$
x^2 – 2y^2=-1
$$

I know that the fundamental solution is $x_1=1$ and $y_1=1$, but I don't know how to get the recurrence relation to get all the solutions.

I have seen found here that the recurrence relation is:
$$
x_{n+1}=3x_n+4y_n,\qquad y_{n+1}=2x_n+3y_n.
$$

Which is similar to the recurrence relation for positive Pell's equations found on Wikipedia:

$$
x_{k+1} = x_1x_k+ny_1y_k,\qquad
y_{k+1} = x_1y_k+y_1x_k
$$

Using $x_1=3$ and $y_1=2$, but I don't understand why do we use those values instead of those of the fundamental solution.

How are the recurrence relations for negative Pell's equations obtained? (particularly for this case)

Best Answer

Building on the comment from @J.W.Tanner, $$x_{n+1}+\sqrt2y_{n+1}=(x_n+\sqrt2y_n)(3+2\sqrt2)=(3x_n+4y_n)+(2x_n+3y_n)\sqrt2$$ is one way to get $x_{n+1}=3x_n+4y_n$, $y_{n+1}=2x_n+3y_n$.

Related Question