OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-3,4,-3,2,-1).
FORMULA
From Chai Wah Wu, Mar 20 2017: (Start)
a(n) = 2*a(n-1) - 3*a(n-2) + 4*a(n-3) - 3*a(n-4) + 2*a(n-5) - a(n-6) for n > 5.
G.f.: x^2*(x^2 - x + 2)/((x - 1)^2*(x^2 + 1)^2). (End)
From Luce ETIENNE, Apr 08 2017: (Start)
a(n) = (4*n+2+(-1)^((2*n+1-(-1)^n)/4)-(2*n+3)*(-1)^((2*n-1+(-1)^n)/4))/8.
a(n) = (2*n+1-(n+1)*cos(n*Pi/2)-(n+2)*sin(n*Pi/2))/4. (End)
MATHEMATICA
Table[Switch[Mod[n, 4], 0, n/4, 1, (n - 1)/4, 2, 3 (n - 2)/4 + 2, _, 3 (n - 3)/4 + 3], {n, 0, 78}] (* or *)
CoefficientList[Series[x^2*(x^2 - x + 2)/((x - 1)^2*(x^2 + 1)^2), {x, 0, 78}], x] (* Michael De Vlieger, Mar 20 2017 *)
LinearRecurrence[{2, -3, 4, -3, 2, -1}, {0, 0, 2, 3, 1, 1}, 100] (* Harvey P. Dale, Mar 26 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Sep 19 2007
STATUS
approved