Solving x2 –xy –{(D –1)/4}y2 = ±1 using the nearest square continued fraction of (1+√D)/2, D≡ 1(mod 4)

Our account is based on Midpoint criteria for solving Pell's equation using the nearest square continued fraction (joint with John Robertson and Jim White, to appear Math. Comp. 29th July 2008).
Also see papers by A.A. Krisnaswami Ayyangar at http://www.ms.uky.edu/~sohum/AAK/PRELUDE.htm.

E = 1 prints complete quotients, partial numerators and denominators and convergents;
E = 0 prints the least positive integer solution of x2– xy – {(D – 1)/4}y2 = ±1 and the NSCF period length of (1 + √D)/2, D ≡1 (mod 4).

Enter D (D = 4n + 1, 13 ≤ D < 1016 and non-square:)
Enter E (0 or 1):

Last modified 8th August 2008
Return to main page