login
A010202
Continued fraction for sqrt(149).
1
12, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1, 5, 3, 3, 5, 1, 4, 24, 4, 1
OFFSET
0,1
MATHEMATICA
ContinuedFraction[Sqrt[149], 300] (* Vladimir Joseph Stephan Orlovsky, Mar 13 2011 *)
PadRight[{12}, 120, {24, 4, 1, 5, 3, 3, 5, 1, 4}] (* Harvey P. Dale, Apr 04 2020 *)
PROG
(Magma) SetDefaultRealField(RealField(120)); ContinuedFraction(Sqrt(149)); // Vincenzo Librandi, Apr 10 2020
(Python)
from sympy import sqrt
from sympy.ntheory.continued_fraction import continued_fraction_iterator
def aupton(nn):
gen = continued_fraction_iterator(sqrt(149))
return [next(gen) for i in range(nn+1)]
print(aupton(83)) # Michael S. Branicky, Dec 04 2021
(Python) # second version based on recurrence
def a(n): return 12 if n == 0 else [4, 1, 5, 3, 3, 5, 1, 4, 24][(n-1)%9]
print([a(n) for n in range(84)]) # Michael S. Branicky, Dec 04 2021
CROSSREFS
Sequence in context: A038329 A098909 A261403 * A079792 A079791 A018812
KEYWORD
nonn,cofr
STATUS
approved