A010121 Continued fraction for sqrt(7).
2, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4
Offset: 0
Examples
2.645751311064590590501615753... = A010465 = 2 + 1/(1 + 1/(1 + 1/(1 + 1/(4 + ...)))).
References
- James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 276.
Links
- Harry J. Smith, Table of n, a(n) for n = 0..20000
- C. Elsner, Series of Error Terms for Rational Approximations of Irrational Numbers, J. Int. Seq. 14 (2011) # 11.1.4, example 5.
- G. Xiao, Contfrac
- Index entries for continued fractions for constants
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Crossrefs
Cf. A010465 (decimal expansion).
Programs
-
Mathematica
ContinuedFraction[Sqrt[7],300] (* Vladimir Joseph Stephan Orlovsky, Mar 04 2011 *) CoefficientList[Series[(2 x^2 + 3 x + 2) (x^2 - x + 1) / ((1 - x) (1 + x) (x^2 + 1)), {x, 0, 100}], x] (* Vincenzo Librandi, Nov 26 2016 *) PadRight[{2},120,{4,1,1,1}] (* Harvey P. Dale, Nov 30 2019 *)
-
PARI
{ allocatemem(932245000); default(realprecision, 13000); x=contfrac(sqrt(7)); for (n=0, 20000, write("b010121.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 01 2009
Formula
From R. J. Mathar, Jun 17 2009: (Start)
G.f.: -(2*x^2+3*x+2)*(x^2-x+1)/((x-1)*(1+x)*(x^2+1)).
a(n) = a(n-4), n > 4. (End)
a(n) = (7 + 3*(-1)^n + 3*(-i)^n + 3*i^n)/4, n > 0, where i is the imaginary unit. - Bruno Berselli, Feb 18 2011
Comments