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
a(n) = Sum_{i=1..floor(n/2)} (i+1)*(n-i+2) = floor(n/2)*(-2*floor(n/2)^2 + 3*n*floor(n/2) + 9*n + 14)/6, n>1. - Wesley Ivan Hurt, Sep 20 2013
G.f.: x^2*(6 + 2*x - 4*x^2 - x^3 + x^4) / ( (1+x)^3*(x-1)^4 ). - R. J. Mathar, Sep 25 2013
a(n) = 6*A058187(n-2) +2*A058187(n-3) -4*A058187(n-4) -A058187(n-5) +A058187(n-6). - R. J. Mathar, Sep 25 2013
a(n) = ( 4*n^3 + 33*n^2 + 38*n - 27 )/48 + (-1)^n*(n+3)^2/16. - R. J. Mathar, Sep 25 2013
E.g.f.: (1/24)*( x*(2*x^2 + 24*x + 27)*cosh(x) + (2*x^3 + 21*x^2 + 48*x - 27)*sinh(x) ). - G. C. Greubel, Jul 13 2022
MAPLE
seq(sum((i+1)*(k-i+2), i=1..floor(k/2)), k=2..70); # Wesley Ivan Hurt, Sep 20 2013
MATHEMATICA
Table[Floor[n/2] (-2Floor[n/2]^2 +3n*Floor[n/2] +9n +14)/6, {n, 2, 100}] (* Wesley Ivan Hurt, Sep 20 2013 *)
CoefficientList[Series[(6 +2x -4x^2 -x^3 +x^4)/((1+x)^3 (1-x)^4), {x, 0, 60}], x] (* Vincenzo Librandi, Sep 26 2013 *)
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {6, 8, 22, 27, 52, 61, 100}, 50] (* Harvey P. Dale, Aug 11 2023 *)
PROG
(Magma) [19*n/24-9/16+n^3/12+11*n^2/16+(-1)^n*(3*n/8 +9/16+n^2/16): n in [2..50]]; // Vincenzo Librandi, Sep 26 2013
(SageMath) [(1/48)*(4*n^3 +33*n^2 +38*n -27 +3*(-1)^n*(n+3)^2) for n in (2..60)] # G. C. Greubel, Jul 13 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved