OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Ron Knott, An Introduction to Continued Fractions
K. S. Williams and N. Buck, Comparison of the lengths of the continued fractions of sqrt(D) and (1/2)*(1+sqrt(D)), Proc. Amer. Math. Soc. 120 (1994) 995-1002.
FORMULA
EXAMPLE
a(7) = 2 because 11 is the 7th smallest squarefree integer and (1 + sqrt 11)/2 = [2,6,3,6,3,6,3,... ] thus has an eventual period of 2. We omit 1 from the list of squarefree integers.
MATHEMATICA
(* first do *) Needs["NumberTheory`NumberTheoryFunctions`"] (* then *) s = Drop[ Select[ Range[162], SquareFreeQ[ # ] &], 1]; Length[ ContinuedFraction[ # ][[2]]] & /@ ((1 + Sqrt[s])/2) (* Robert G. Wilson v, May 27 2005 *)
Length[ContinuedFraction[(Sqrt[#]+1)/2][[2]]]&/@Select[Range[ 2, 200], SquareFreeQ] (* Harvey P. Dale, Aug 16 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Steven Finch, May 24 2005
EXTENSIONS
More terms from Robert G. Wilson v, May 27 2005
STATUS
approved