A013646 Least m such that the continued fraction for sqrt(m) has period n.
1, 2, 3, 41, 7, 13, 19, 58, 31, 106, 43, 61, 46, 193, 134, 109, 94, 157, 139, 337, 151, 181, 166, 586, 271, 457, 211, 949, 334, 821, 379, 601, 463, 613, 331, 1061, 478, 421, 619, 541, 526, 1117, 571, 1153, 604, 1249, 694, 1069, 631, 1021, 1051, 1201, 751, 1669, 886
Offset: 0
References
- Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).
Links
- Patrick McKinley, Table of n, a(n) for n = 0..97920 (first 1000 terms from T. D. Noe)
- Michael Hortmann, Table of n, a(n) for n = 0..1000000
Programs
-
Mathematica
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 *) 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 *)
Formula
A003285(a(n)) = n. - Pontus von Brömssen, Nov 24 2024
Comments