A035015 Period of continued fraction for square root of n-th squarefree integer.
1, 2, 1, 2, 4, 1, 2, 5, 4, 2, 1, 6, 6, 6, 4, 1, 5, 2, 8, 4, 4, 2, 1, 2, 2, 3, 2, 10, 12, 4, 2, 5, 4, 6, 7, 6, 11, 4, 1, 2, 10, 8, 6, 8, 7, 5, 6, 4, 4, 1, 2, 5, 10, 2, 5, 8, 10, 16, 4, 11, 1, 2, 12, 2, 9, 6, 15, 2, 6, 9, 6, 10, 10, 4, 1, 2, 12, 10, 3, 6, 16, 14, 9, 4, 18, 4, 4, 2, 1, 2, 9, 20, 10, 4
Offset: 2
Examples
a(2)=1 because 2 is the 2nd smallest squarefree integer and sqrt 2 = [ 1,2,2,2,2,... ] thus has an eventual period of 1.
Links
- David W. Wilson, Table of n, a(n) for n = 2..10000
- S. R. Finch, Class number theory [broken link]
- Steven R. Finch, Class number theory [Cached copy, with permission of the author]
- Christian Friesen, On continued fractions of given period, Proc. Amer. Math. Soc. 103 (1988), 9-14.
- Ron Knott, An Introduction to Continued Fractions
Programs
-
Maple
sqf:= select(numtheory:-issqrfree,[$2..1000]): map(n->nops(numtheory:-cfrac(sqrt(n),'periodic','quotients')[2]),sqf); # Robert Israel, Dec 21 2014
-
Mathematica
Length[ContinuedFraction[Sqrt[#]][[2]]]&/@Select[ Range[ 2,200], SquareFreeQ] (* Harvey P. Dale, Jul 17 2011 *)
Formula
Extensions
Corrected and extended by James Sellers
Comments