login
A040134
Continued fraction for sqrt(147).
0
12, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8, 24, 8
OFFSET
0,1
MAPLE
Digits := 100: convert(evalf(sqrt(N)), confrac, 90, 'cvgts'):
MATHEMATICA
ContinuedFraction[Sqrt[147], 300] (* Vladimir Joseph Stephan Orlovsky, Mar 13 2011*)
LinearRecurrence[{0, 1}, {12, 8, 24}, 80] (* or *) PadRight[{12}, 80, {24, 8}] (* Harvey P. Dale, Jun 11 2017 *)
PROG
(Python)
from sympy import sqrt
from sympy.ntheory.continued_fraction import continued_fraction_iterator
def aupton(nn):
gen = continued_fraction_iterator(sqrt(147))
return [next(gen) for i in range(nn+1)]
print(aupton(73)) # Michael S. Branicky, Dec 08 2021
(Python) # second version based on recurrence
def a(n): return 12 if n == 0 else [8, 24][(n-1)%2]
print([a(n) for n in range(74)]) # Michael S. Branicky, Dec 08 2021
CROSSREFS
Sequence in context: A324976 A261402 A307171 * A258641 A206478 A164675
KEYWORD
nonn,cofr,easy
AUTHOR
STATUS
approved