%I #44 Mar 16 2023 05:53:57
%S 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,
%T 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,
%U 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
%N Period of continued fraction for square root of n-th squarefree integer.
%C Friesen proved that each value appears infinitely often. - _Michel Marcus_, Apr 12 2019
%H David W. Wilson, <a href="/A035015/b035015.txt">Table of n, a(n) for n = 2..10000</a>
%H S. R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/">Class number theory</a> [broken link]
%H Steven R. Finch, <a href="/A000924/a000924.pdf">Class number theory</a> [Cached copy, with permission of the author]
%H Christian Friesen, <a href="https://doi.org/10.1090/S0002-9939-1988-0938635-4">On continued fractions of given period</a>, Proc. Amer. Math. Soc. 103 (1988), 9-14.
%H Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/cfINTRO.html">An Introduction to Continued Fractions</a>
%F a(n) = A003285(A005117(n)). - _Michel Marcus_, Dec 29 2014
%e 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.
%p sqf:= select(numtheory:-issqrfree,[$2..1000]):
%p map(n->nops(numtheory:-cfrac(sqrt(n),'periodic','quotients')[2]),sqf); # _Robert Israel_, Dec 21 2014
%t Length[ContinuedFraction[Sqrt[#]][[2]]]&/@Select[ Range[ 2,200], SquareFreeQ] (* _Harvey P. Dale_, Jul 17 2011 *)
%Y Cf. A003285, A005117 (squarefree numbers), A013943.
%K nonn,easy,nice
%O 2,2
%A David L. Treumann (alewifepurswest(AT)yahoo.com)
%E Corrected and extended by _James A. Sellers_