VOOZH about

URL: https://oeis.org/A010187

⇱ A010187 - OEIS


login
A010187
Continued fraction for sqrt(126).
1
11, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4, 22, 4, 2, 4
OFFSET
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
CROSSREFS
Sequence in context: A088073 A385331 A352162 * A381151 A372761 A248175
KEYWORD
nonn,cofr
STATUS
approved