OFFSET
1,2
LINKS
Patrick McKinley, Table of n, a(n) for n=1..512
FORMULA
MATHEMATICA
per[n_] := ContinuedFraction[Sqrt[n]][[2]] // Length; record = 0; t = Reap[For[n = 1, n < 2*10^4, n++, If[ !IntegerQ[Sqrt[n]], p = per[n]; If[p > record, record = p; Print[{n, p}]; Sow[{n, p}]]]]][[2, 1]]; A020640 = t[[All, 2]] (* Jean-François Alcover, Dec 27 2012 *)
DeleteDuplicates[Table[If[IntegerQ[Sqrt[n]], Nothing, Length[ContinuedFraction[Sqrt[n]][[2]]]], {n, 20000}], GreaterEqual] (* Harvey P. Dale, Dec 28 2023 *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
STATUS
approved