Fouvry É, Klüners J. On the negative Pell equation. Annals of Mathematics. 2010;172(3):2035-2104. doi:10.4007/annals.2010.172.2035