Pell equation (source code)

= Pell equation
{c}
{wiki}

For a nonsquare positive integer $D$, the Pell equation is
$$
x^2-Dy^2=1.
$$
Periodic <continued fraction>[continued fractions] of $\sqrt D$ produce infinitely many integer solutions.