OFFSET
2,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 2..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
G.f.: x^2*(3+2*x+3*x^2) / ((1+x)^3*(x-1)^4). - R. J. Mathar, Sep 25 2013
From Colin Barker, Jan 29 2016: (Start)
a(n) = (8*n^3 + 6*(-1)^n*n^2 + 12*n^2 + 6*(-1)^n*n - 2*n + 3*(-1)^n - 3)/48.
a(n) = (4*n^3 + 9*n^2 + 2*n)/24 for n even.
a(n) = (4*n^3 + 3*n^2 - 4*n - 3)/24 for n odd. (End)
E.g.f.: (1/48)*(3*(1 - 4*x + 2*x^2)*exp(-x) + (-3 + 18*x + 36*x^2 + 8*x^3)*exp(x)). - G. C. Greubel, Apr 19 2023
MATHEMATICA
CoefficientList[Series[(3+2x+3x^2)/((1+x)^3 (1-x)^4), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 25 2013 *)
PROG
(PARI) Vec(x^2*(3+2*x+3*x^2)/((1+x)^3*(x-1)^4) + O(x^100)) \\ Colin Barker, Jan 29 2016
(Magma) [((2*n-1)*(2*n+1)*(2*n+3) +3*(-1)^n*(n^2+(n+1)^2))/48: n in [2..50]]; // G. C. Greubel, Apr 19 2023
(SageMath) [((2*n-1)*(2*n+1)*(2*n+3) +3*(-1)^n*(n^2+(n+1)^2))/48 for n in range(2, 51)] # G. C. Greubel, Apr 19 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved