login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A040134 Continued fraction for sqrt(147). 0

%I #27 Dec 26 2023 23:59:33

%S 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,

%T 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,

%U 24,8,24,8,24,8,24,8,24,8,24,8,24,8,24,8,24,8,24,8

%N Continued fraction for sqrt(147).

%H <a href="/index/Con#confC">Index entries for continued fractions for constants</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,1).

%p Digits := 100: convert(evalf(sqrt(N)),confrac,90,'cvgts'):

%t ContinuedFraction[Sqrt[147],300] (* _Vladimir Joseph Stephan Orlovsky_, Mar 13 2011*)

%t LinearRecurrence[{0,1},{12,8,24},80] (* or *) PadRight[{12},80,{24,8}] (* _Harvey P. Dale_, Jun 11 2017 *)

%o (Python)

%o from sympy import sqrt

%o from sympy.ntheory.continued_fraction import continued_fraction_iterator

%o def aupton(nn):

%o gen = continued_fraction_iterator(sqrt(147))

%o return [next(gen) for i in range(nn+1)]

%o print(aupton(73)) # _Michael S. Branicky_, Dec 08 2021

%o (Python) # second version based on recurrence

%o def a(n): return 12 if n == 0 else [8, 24][(n-1)%2]

%o print([a(n) for n in range(74)]) # _Michael S. Branicky_, Dec 08 2021

%K nonn,cofr,easy

%O 0,1

%A _N. J. A. Sloane_.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)