OFFSET
0,3
COMMENTS
More generally, the ordinary generating function for the alternating sum of k-gonal pyramidal numbers is x*(1 + (3 - k)*x)/((x - 1)*(x + 1)^4).
LINKS
Ilya Gutkovskiy, Extended graphic representation
OEIS Wiki, Figurate numbers
Eric Weisstein's World of Mathematics, Pyramidal Number
Eric Weisstein's World of Mathematics, Hexagonal Pyramidal Number
Index entries for linear recurrences with constant coefficients, signature (-3,-2,2,3,1).
FORMULA
G.f.: x*(1 - 3*x)/((x - 1)*(x + 1)^4).
a(n) = ((-1)^n*(2*n*(n + 2)*(4*n + 1) - 3) + 3)/24.
a(n) = Sum_{k = 0..n} (-1)^k*A002412(k).
MATHEMATICA
Table[((-1)^n (2 n (n + 2) (4 n + 1) - 3) + 3)/24, {n, 0, 40}]
LinearRecurrence[{-3, -2, 2, 3, 1}, {0, -1, 6, -16, 34}, 40]
PROG
(PARI) concat(0, Vec(x*(1 - 3*x)/((x - 1)*(x + 1)^4) + O(x^50))) \\ Michel Marcus, Feb 02 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Ilya Gutkovskiy, Feb 02 2016
STATUS
approved