### Solving a generalized Pell equation

We investigate the solubility in positive integers of the diophantine equation ax^{2}-by^{2}=±1,
where 1 < a < b, gcd(a,b)= 1 and ab is not a perfect square.

In the case of solubility, we return the least positive solution.

The algorithm used was pointed out by Jim White and is described in a note.

A BC version is available here.

*Last modified 8th May 2012*

Return to main page