OFFSET
0,1
LINKS
G. Xiao, Contfrac
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,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
KEYWORD
nonn,cofr
AUTHOR
STATUS
approved