%I #17 Aug 29 2018 18:05:00
%S 0,1,-1,3,4,12,21,34,56,75,115,141,204,238,329,372,496,549,711,775,
%T 980,1056,1309,1398,1704,1807,2171,2289,2716,2850,3345,3496,4064,4233,
%U 4879,5067,5796,6004,6821,7050,7960,8211,9219,9493,10604,10902,12121,12444,13776,14125,15575
%N Expansion of x*(1 - 2*x + x^2 + 7*x^3 - x^4)/((1 - x)^4*(1 + x)^3).
%C The n-th generalized n-gonal number (for n >= 5).
%H Alois P. Heinz, <a href="/A292551/b292551.txt">Table of n, a(n) for n = 0..10000</a>
%H <a href="/index/Pol#polygonal_numbers">Index to sequences related to polygonal numbers</a>
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3,-3,3,1,-1).
%F G.f.: x*(1 - 2*x + x^2 + 7*x^3 - x^4)/((1 - x)^4*(1 + x)^3).
%F a(n) = [x^n] x*(1 + (n - 4)*x + x^2)/((1 - x)^3*(1 + x)^2).
%F E.g.f.: (1/16)*((-6 + 9*x + 2*x^2)*exp(-x) + (6 - 5*x + 4*x^2 + 2*x^3)*exp(x)).
%F a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3) - 3*a(n-4) + 3*a(n-5) + a(n-6) - a(n-7).
%F a(n) = (2*n^3 - 2*n^2 + (-1)^n*(2*n^2 - 11*n - 6) - 5*n + 6)/16.
%p a:= n-> (m-> m*((n-2)*m-(n-4))/2)(-ceil(n/2)*(-1)^n):
%p seq(a(n), n=0..100); # _Alois P. Heinz_, Aug 29 2018
%t CoefficientList[Series[x (1 - 2 x + x^2 + 7 x^3 - x^4)/((1 - x)^4 (1 + x)^3), {x, 0, 50}], x]
%t Table[SeriesCoefficient[x (1 + (n - 4) x + x^2)/((1 - x)^3 (1 + x)^2), {x, 0, n}], {n, 0, 50}]
%t LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {0, 1, -1, 3, 4, 12, 21}, 51]
%t Table[(2 n^3 - 2 n^2 + (-1)^n (2 n^2 - 11 n - 6) - 5 n + 6)/16, {n, 0, 50}]
%o (PARI) x='x+O('x^99); concat(0, Vec(x*(1-2*x+x^2+7*x^3-x^4)/((1-x)^4*(1+x)^3))) \\ _Altug Alkan_, Sep 18 2017
%o (GAP) List([0..50],n->(2*n^3-2*n^2+(-1)^n*(2*n^2-11*n-6)-5*n+6)/16); # _Muniru A Asiru_, Aug 08 2018
%Y Cf. A006484, A060354, A100119, A195152.
%Y Main diagonal of A303301.
%K easy,sign
%O 0,4
%A _Ilya Gutkovskiy_, Sep 18 2017