cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A013646 Least m such that the continued fraction for sqrt(m) has period n.

This page as a plain text file.
%I A013646 #57 Nov 24 2024 09:25:13
%S A013646 1,2,3,41,7,13,19,58,31,106,43,61,46,193,134,109,94,157,139,337,151,
%T A013646 181,166,586,271,457,211,949,334,821,379,601,463,613,331,1061,478,421,
%U A013646 619,541,526,1117,571,1153,604,1249,694,1069,631,1021,1051,1201,751,1669,886
%N A013646 Least m such that the continued fraction for sqrt(m) has period n.
%C A013646 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 A013646 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 A013646 a(999213) = 133511789629, a(1000000) = 98814608764. - _Michael Hortmann_, Mar 20 2023
%D A013646 Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).
%H A013646 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 A013646 Michael Hortmann, <a href="https://www.math.uni-Bremen.de/~michaelh/FirstOccurrence1000000.txt">Table of n, a(n) for n = 0..1000000</a>
%F A013646 A003285(a(n)) = n. - _Pontus von Brömssen_, Nov 24 2024
%t A013646 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 A013646 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 A013646 Cf. A003285, A215485.
%K A013646 nonn,nice
%O A013646 0,2
%A A013646 _N. J. A. Sloane_, _Clark Kimberling_, Walter Gilbert