%I #26 Mar 31 2021 20:24:02
%S 0,-1,7,-20,44,-81,135,-208,304,-425,575,-756,972,-1225,1519,-1856,
%T 2240,-2673,3159,-3700,4300,-4961,5687,-6480,7344,-8281,9295,-10388,
%U 11564,-12825,14175,-15616,17152,-18785,20519
%N Alternating sum of cubes, i.e., Sum_{k=0..n} k^p*q^k for p=3, q=-1.
%H Stanislav Sykora, <a href="/A232599/b232599.txt">Table of n, a(n) for n = 0..1000</a>
%H S. Sykora, <a href="http://dx.doi.org/10.3247/SL1Math06.002">Finite and Infinite Sums of the Power Series (k^p)(x^k)</a>, DOI 10.3247/SL1Math06.002, Section V.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (-3,-2,2,3,1).
%F a(n) = ((-1)^n*(4*n^3+6*n^2-1) +1)/8.
%F G.f.: (-x)*(1-4*x+x^2) / ( (1-x)*(1+x)^4 ). - _R. J. Mathar_, Nov 23 2014
%F E.g.f.: (exp(x) - (1 +10*x -18*x^2 +4*x^3)*exp(-x))/8. - _G. C. Greubel_, Mar 31 2021
%F a(n) = - 3*a(n-1) - 2*a(n-2) + 2*a(n-3) + 3*a(n-4) + a(n-5). - _Wesley Ivan Hurt_, Mar 31 2021
%e a(3) = 0^3 - 1^3 + 2^3 - 3^3 = -20.
%p A232599:= n-> (1 -(-1)^n*(1 -6*n^2 -4*n^3))/8; seq(A232599(n), n=0..30); # _G. C. Greubel_, Mar 31 2021
%t Accumulate[Times@@@Partition[Riffle[Range[0,40]^3,{1,-1},{2,-1,2}],2]] (* _Harvey P. Dale_, Jul 22 2016 *)
%o (PARI) S3M1(n)=((-1)^n*(4*n^3+6*n^2-1)+1)/8;
%o v = vector(10001);for(k=1,#v,v[k]=S3M1(k-1))
%o (Magma) [(1 - (-1)^n*(1 -6*n^2 -4*n^3))/8: n in [0..30]]; // _G. C. Greubel_, Mar 31 2021
%o (Sage) [(1 - (-1)^n*(1 -6*n^2 -4*n^3))/8 for n in (0..30)] # _G. C. Greubel_, Mar 31 2021
%Y Cf. A000578 (cubes), A011934 (absolute values), A059841 (p=0,q=-1), A130472 (p=1,q=-1), A089594 (p=2,q=-1), A126646 (p=0,q=2), A036799 (p=1,q=2), A036800 (p=2,q=2), A036827 (p=3,q=2), A077925 (p=0,q=-2), A232600 (p=1,q=-2), A232601 (p=2,q=-2), A232602 (p=3,q=-2), A232603 (p=2,q=-1/2), A232604 (p=3,q=-1/2).
%K sign,easy
%O 0,3
%A _Stanislav Sykora_, Nov 26 2013