OFFSET
1,1
LINKS
Bruno Berselli, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-4,4,-3,1).
FORMULA
G.f.: x*(3 - 4*x + 8*x^2 - 4*x^3 + 3*x^4)/((1 + x^2)*(1 - x)^3).
a(n) = (3*n^2 - 3*n + cos(n*Pi/2) + sin(n*Pi/2) + 5)/2.
a(n) = 3*(n-1)^2 - 3*(n-1) - a(n-2) + 8 for n>2.
a(n) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3) - 3*a(n-4) + a(n-5) for n>5. - Colin Barker, Feb 22 2016
MATHEMATICA
Table[(3 (n - 1) n + (-1)^((n - 1) n/2) + 5)/2, {n, 100}]
LinearRecurrence[{3, -4, 4, -3, 1}, {3, 5, 11, 21, 33}, 100]
CoefficientList[Series[(3-4*x+8*x^2-4*x^3+3*x^4)/((1+x^2)*(1-x)^3), {x, 0, 100}], x]
PROG
(PARI) Vec((3-4*x+8*x^2-4*x^3+3*x^4)/((1+x^2)*(1-x)^3) + O(x^60)) \\ Michel Marcus, Feb 22 2016
(Magma) I:=[3, 5]; [n le 2 select I[n] else 3*(n-1)^2-3*(n-1)- Self(n-2)+8: n in [1..50]]; // Vincenzo Librandi, Feb 22 2016
(Sage) [(3*(n-1)*n+(-1)^((n-1)*n/2)+5)/2 for n in (1..50)] # Bruno Berselli, Feb 23 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Feb 19 2016
EXTENSIONS
Edited by Bruno Berselli, Feb 23 2016
STATUS
approved