OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(n) = A045975(n,n);
a(n) = A079326(n+1) * n;
G.f.: -x*(-1-3*x-14*x^2-6*x^3-x^4+x^5) / ((1+x)^3*(x-1)^4). - R. J. Mathar, Aug 13 2012
From Colin Barker, Jan 28 2016: (Start)
a(n) = n*(2*n^2+(3-(-1)^n)*n-(-1)^n-3)/4.
a(n) = (n^3+n^2-2*n)/2 for n even.
a(n) = (n^3+2*n^2-n)/2 for n odd.
(End)
MATHEMATICA
Table[n*(2*n^2+(3-(-1)^n)*n-(-1)^n-3)/4, {n, 1, 50}] (* G. C. Greubel, Jun 15 2018 *)
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {1, 4, 21, 36, 85, 120, 217}, 50] (* Harvey P. Dale, Feb 20 2021 *)
PROG
(Haskell)
a204557 = last . a045975_row
(PARI) Vec(-x*(-1-3*x-14*x^2-6*x^3-x^4+x^5)/((1+x)^3*(x-1)^4) + O(x^100)) \\ Colin Barker, Jan 28 2016
(Magma) [n*(2*n^2+(3-(-1)^n)*n-(-1)^n-3)/4: n in [1..50]]; // G. C. Greubel, Jun 15 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jan 18 2012
STATUS
approved