Solving the Pell equations using NSCF

This is a program for finding the least solution of diophantine equations x2 - dy2 = ±1.

e=1 prints the complete quotients (P+√d)/Q, convergents and partial quotients of the period of the nearest square continued fraction (NSCF) expansion of √d.
e=0 prints only the cfrac and solutions of the Pell equations.

Our account is based on page 407 of Solving the Pell Equation by H.C. Williams, Proc. Millennial Conference on Number Theory, A.K. Peters, 2002, pp. 397-435. Also see papers by A.A. Krisnaswami Ayyangar at http://www.ms.uky.edu/~sohum/AAK/PRELUDE.htm.

Enter d (< 1010):
Enter e (0 or 1):

Last modified 7th August 2008
Return to main page