%I #54 Oct 30 2023 07:24:36
%S 1,2,3,41,7,13,19,58,31,106,43,61,46,193,134,109,94,157,139,337,151,
%T 181,166,586,271,457,211,949,334,821,379,601,463,613,331,1061,478,421,
%U 619,541,526,1117,571,1153,604,1249,694,1069,631,1021,1051,1201,751,1669,886
%N Least m such that continued fraction for sqrt(m) has period n.
%C In a search of fractions up to sqrt(1650241399), the smallest length not yet seen is 97921. The next unseen lengths are 101679, 102181 and 102407. After 145 more missing odd lengths, the first even length not seen is 107292. This would suggest that A215485 may be exclusively odd after an early 2, but beware the law of small numbers! - _Patrick McKinley_, Aug 24 2012
%C a(97921) = 1664155249, a(101679) = 1654486681, a(102181) = 1682919001, a(102407) = 1680133849, a(107292) = 1651931884, thus 107292 is not in A215485. - _Chai Wah Wu_, Jun 08 2017
%C a(999213) = 133511789629, a(1000000) = 98814608764. - _Michael Hortmann_, Mar 20 2023
%D Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).
%H Patrick McKinley, <a href="/A013646/b013646.txt">Table of n, a(n) for n = 0..97920</a> (first 1000 terms from T. D. Noe)
%H Michael Hortmann, <a href="https://www.math.uni-Bremen.de/~michaelh/FirstOccurrence1000000.txt">Table of n, a(n) for n = 0..1000000</a>
%t a[n_] := Catch[For[m = 1, True, m++, If[Length[ Last[ ContinuedFraction[ Sqrt[m] ]]] == n, Print[m]; Throw[m] ]]]; Table[a[n], {n, 0, 54}](* _Jean-François Alcover_, May 15 2012 *)
%t Flatten[Table[Position[Table[{s=Sqrt[n]};If[IntegerQ[s],0,Length[ ContinuedFraction[s] [[2]]]], {n,2000}],i,{1},1],{i,0,60}]] (* _Harvey P. Dale_, Sep 15 2013 *)
%Y Cf. A215485.
%K nonn,nice
%O 0,2
%A _N. J. A. Sloane_, _Clark Kimberling_, Walter Gilbert