Computing the period of the continued fraction expansion of √d

The algorithm is based on K. Rosen, Elementary number theory and its applications, p.382, using the Pohst-Zassenhaus device of half the period k. See note, where it is shown that Qh = Qh+1 if k = 2h + 1, while Ph = Ph+1 if k = 2h.

Enter d (1 < d < 1016 and non-square:)

Last modified 16th February 2007
Return to main page