%I #39 Jan 26 2023 19:00:21
%S 0,-1,6,-12,22,-33,48,-64,84,-105,130,-156,186,-217,252,-288,328,-369,
%T 414,-460,510,-561,616,-672,732,-793,858,-924,994,-1065,1140,-1216,
%U 1296,-1377,1462,-1548,1638,-1729,1824,-1920,2020,-2121,2226,-2332,2442,-2553
%N Alternating sum of heptagonal numbers.
%H G. C. Greubel, <a href="/A266085/b266085.txt">Table of n, a(n) for n = 0..5000</a>
%H OEIS Wiki, <a href="http://oeis.org/wiki/Figurate_numbers">Figurate numbers</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HeptagonalNumber.html">Heptagonal Number</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (-2,0,2,1).
%F G.f.: -x*(1 - 4*x)/((1 - x)*(1 + x)^3).
%F a(n) = ((10*n^2 + 4*n - 3)*(-1)^n + 3)/8.
%F a(n) = Sum_{k = 0..n} (-1)^k*A000566(k).
%F Lim_{n -> infinity} a(n + 1)/a(n) = -1.
%F a(n) = (-1)^n*A008728(5*n-5) for n>0. - _Bruno Berselli_, Dec 21 2015
%F E.g.f.: (1/8)*exp(-x)*(-3 + 3*exp(2*x) - 14*x + 10*x^2). - _Stefano Spezia_, Nov 13 2019
%t Table[((10 n^2 + 4 n - 3) (-1)^n + 3)/8, {n, 0, 50}]
%t CoefficientList[Series[(x - 4 x^2)/(x^4 + 2 x^3 - 2 x - 1), {x, 0, 50}], x] (* _Vincenzo Librandi_, Dec 21 2015 *)
%t LinearRecurrence[{-2,0,2,1},{0,-1,6,-12},60] (* _Harvey P. Dale_, Jan 26 2023 *)
%o (Magma) [((10*n^2+4*n-3)*(-1)^n+3)/8: n in [0..50]]; // _Vincenzo Librandi_, Dec 21 2015
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 50); [0] cat Coefficients(R!(-x*(1 - 4*x)/((1 - x)*(1 + x)^3))); // _Marius A. Burtea_, Nov 13 2019
%o (PARI) x='x+O('x^100); concat(0, Vec(-x*(1-4*x)/((1-x)*(1+x)^3))) \\ _Altug Alkan_, Dec 21 2015
%Y Cf. A000566, A002413, A006578, A008728, A035608, A083392, A089594.
%Y Unsigned terms give antidiagonal sums of A204154. - _Nathaniel J. Strout_, Nov 14 2019
%K sign,easy
%O 0,3
%A _Ilya Gutkovskiy_, Dec 21 2015
|