cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A266677 Alternating sum of hexagonal pyramidal numbers.

Original entry on oeis.org

0, -1, 6, -16, 34, -61, 100, -152, 220, -305, 410, -536, 686, -861, 1064, -1296, 1560, -1857, 2190, -2560, 2970, -3421, 3916, -4456, 5044, -5681, 6370, -7112, 7910, -8765, 9680, -10656, 11696, -12801, 13974, -15216, 16530, -17917, 19380, -20920, 22540
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 02 2016

Keywords

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).

Crossrefs

Programs

  • 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]
  • PARI
    concat(0, Vec(x*(1 - 3*x)/((x - 1)*(x + 1)^4) + O(x^50))) \\ Michel Marcus, Feb 02 2016

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).