Negative Pell equation (source code)

= Negative Pell equation
{title2=$x^2-Dy^2=-1$}

The <Diophantine equation> $x^2-Dy^2=-1$, usually with a nonsquare <positive integer> $D$ and <integer> unknowns. It need not have a solution. For $D=2$, multiplying $u+v\sqrt2$ by $3+2\sqrt2$ preserves norm $-1$ and gives $(u,v)\mapsto(3u+4v,2u+3v)$.