A266085 Alternating sum of heptagonal numbers.
0, -1, 6, -12, 22, -33, 48, -64, 84, -105, 130, -156, 186, -217, 252, -288, 328, -369, 414, -460, 510, -561, 616, -672, 732, -793, 858, -924, 994, -1065, 1140, -1216, 1296, -1377, 1462, -1548, 1638, -1729, 1824, -1920, 2020, -2121, 2226, -2332, 2442, -2553
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..5000
- OEIS Wiki, Figurate numbers
- Eric Weisstein's World of Mathematics, Heptagonal Number
- Index entries for linear recurrences with constant coefficients, signature (-2,0,2,1).
Crossrefs
Programs
-
Magma
[((10*n^2+4*n-3)*(-1)^n+3)/8: n in [0..50]]; // Vincenzo Librandi, Dec 21 2015
-
Magma
R
:=PowerSeriesRing(Integers(), 50); [0] cat Coefficients(R!(-x*(1 - 4*x)/((1 - x)*(1 + x)^3))); // Marius A. Burtea, Nov 13 2019 -
Mathematica
Table[((10 n^2 + 4 n - 3) (-1)^n + 3)/8, {n, 0, 50}] CoefficientList[Series[(x - 4 x^2)/(x^4 + 2 x^3 - 2 x - 1), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *) LinearRecurrence[{-2,0,2,1},{0,-1,6,-12},60] (* Harvey P. Dale, Jan 26 2023 *)
-
PARI
x='x+O('x^100); concat(0, Vec(-x*(1-4*x)/((1-x)*(1+x)^3))) \\ Altug Alkan, Dec 21 2015
Formula
G.f.: -x*(1 - 4*x)/((1 - x)*(1 + x)^3).
a(n) = ((10*n^2 + 4*n - 3)*(-1)^n + 3)/8.
a(n) = Sum_{k = 0..n} (-1)^k*A000566(k).
Lim_{n -> infinity} a(n + 1)/a(n) = -1.
a(n) = (-1)^n*A008728(5*n-5) for n>0. - Bruno Berselli, Dec 21 2015
E.g.f.: (1/8)*exp(-x)*(-3 + 3*exp(2*x) - 14*x + 10*x^2). - Stefano Spezia, Nov 13 2019