### Finding primitive solutions of the diophantine equation ax^{2}+bxy+cy^{2}=n, where b^{2}-4ac < 0, gcd(a,b,c)=1 and a > 0, n > 0.

This uses a forgotten continued fraction method of Lagrange.

See *Oeuvres de Lagrange*, 725-726.
A description of the algorithm is at
*Lagrange's Algorithm Revisited: Solving at*^{2}+btu+cu^{2}=n in the Case of Negative Discriminant, Journal of Integer Sequences, Vol. 17 (2014), Article 14.11.1.

E = 1 is verbose.

*Last modified 28th August 2014*

Return to main page