A288185 Least even number k such that the continued fraction for sqrt(k) has period n.
2, 6, 130, 14, 74, 22, 58, 44, 106, 86, 298, 46, 746, 134, 1066, 94, 1018, 424, 922, 268, 394, 166, 586, 382, 1306, 214, 1354, 334, 1642, 436, 2122, 508, 1114, 454, 4138, 478, 3194, 1108, 4874, 526, 3418, 724, 2458, 604, 9914, 694, 4618, 844, 2746, 1318
Offset: 1
Keywords
Examples
a(2) = 6, sqrt(6) = 2 + 1/(2 + 1/(4 + 1/(2 + 1/(4 + 1/...)))), period 2: [2, 4].
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Periodic Continued Fraction
Crossrefs
Programs
-
Python
from sympy import continued_fraction_periodic def A288185(n): d = 2 while True: s = continued_fraction_periodic(0,1,d)[-1] if isinstance(s, list) and len(s) == n: return d d += 2 # Chai Wah Wu, Jun 08 2017