The continued fraction of is , and the continued fraction of is
Does the pattern repeat over and over again?
sage: def cf_sqrt_d(d, bits): ... x = sqrt(RealField(bits)(d)) ... return continued_fraction(x) sage: cf_sqrt_d(389,50) [19, 1, 2, 1, 1, 1, 1, 2, 1, 38, 1, 2, 1, 1, 1, 1, 2, 1, 38] sage: cf_sqrt_d(389,100) [19, 1, 2, 1, 1, 1, 1, 2, 1, 38, 1, 2, 1, 1, 1, 1, 2, 1, 38, \ 1, 2, 1, 1, 1, 1, 2, 1, 38, 1, 2, 1, 1, 1, 1, 2, 1, 38, 1, 2, 1, 1]