OFFSET
0,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..100
G. Xiao, Contfrac
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
MATHEMATICA
ContinuedFraction[Sqrt[126], 300] (* Vladimir Joseph Stephan Orlovsky, Mar 12 2011 *)
PROG
(Python)
from sympy import sqrt
from sympy.ntheory.continued_fraction import continued_fraction_iterator
def aupton(nn):
gen = continued_fraction_iterator(sqrt(126))
return [next(gen) for i in range(nn+1)]
print(aupton(71)) # Michael S. Branicky, Nov 04 2021
(Python) # second version based on linear recurrence
def a(n): return 11 if n == 0 else [4, 2, 4, 22][(n-1)%4]
print([a(n) for n in range(72)]) # Michael S. Branicky, Nov 04 2021
(PARI) a(n)=if(n, [22, 4, 2, 4][n%4+1], 11) \\ Charles R Greathouse IV, May 31 2026
CROSSREFS
KEYWORD
nonn,cofr,easy
AUTHOR
STATUS
approved
