OFFSET
0,2
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..20000
G. Xiao, Contfrac
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
From Colin Barker, Sep 08 2013: (Start)
a(n) = (-1+3*(-1)^n-4*(-1+(-1)^n)*n)/2 for n>1.
a(n) = 2*a(n-2)-a(n-4) for n>5.
G.f.: x*(x^4-x^3+4*x^2+x+3) / ((x-1)^2*(x+1)^2). (End)
EXAMPLE
0.25534192122103626650448223... = 0 + 1/(3 + 1/(1 + 1/(10 + 1/(1 + ...)))). - Harry J. Smith, Jun 13 2009
MATHEMATICA
Join[{0, 3}, LinearRecurrence[{0, 2, 0, -1}, {1, 10, 1, 18}, 100]] (* Vincenzo Librandi, Jan 03 2016 *)
PROG
(PARI) { allocatemem(932245000); default(realprecision, 91000); x=contfrac(tan(1/4)); for (n=0, 20000, write("b019427.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 13 2009
(PARI) Vec(x*(x^4-x^3+4*x^2+x+3)/((x-1)^2*(x+1)^2) + O(x^100)) \\ Colin Barker, Sep 08 2013
(Magma) [0, 3] cat [(-1+3*(-1)^n-4*(-1+(-1)^n)*n)/2: n in [2..80]]; // Vincenzo Librandi, Jan 03 2016
CROSSREFS
KEYWORD
nonn,cofr,easy
AUTHOR
STATUS
approved