Solving the diophantine equation ax2-by2=c, using the LMM method

Here a > 0, b > 0, c ≠ 0. Also let D = ab.
This program was written by the author after studying page 84 of the recent book Quadratic Diophantine Equations, Titu Andreescu, Dorin Andrica, Developments in Mathematics, Vol. 40, Springer 2015.
(See note)
We make the transformation X = ax, Y = y and look for the fundamental solutions of the transformed equation X2 - Dy2 = ac. If there are none, then the original equation has no integer solutions. Otherwise each fundamental solution (α, β) for which α is divisible by a, gives rise to a solution family

x = (α/a)u + bβv, y = βu + α v,

where u and v are integers satisfying the equation u2 - Dv2 = 1.

The method works for ac with up to say 20 digits, due to the limitations of the program used to factor ac.

The program is a BCMath version of BC function aa1().

Enter a: (> 0)
Enter b: (> 0)
Enter c: (≠ 0)

Last modified 8th December 2015
Return to main page