login
a(n) = Sum_{k=0..n} k^p*q^k, where p=3, q=-2.
12

%I #21 Mar 31 2021 20:23:17

%S 0,-2,30,-186,838,-3162,10662,-33242,97830,-275418,748582,-1977306,

%T 5100582,-12897242,32060454,-78531546,189903910,-454052826,1074770982,

%U -2521320410,5867287590,-13554437082

%N a(n) = Sum_{k=0..n} k^p*q^k, where p=3, q=-2.

%H Stanislav Sykora, <a href="/A232602/b232602.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 (-7,-16,-8,16,16).

%F a(n) = 2*(1 - (-2)^n*(1 +3*n -9*n^2 -9*n^3))/27.

%F G.f.: -2*x*(1-8*x+4*x^2) / ( (1-x)*(1+2*x)^4 ). - _R. J. Mathar_, Nov 23 2014

%F E.g.f.: (2/27)*(exp(x) - (1 +30*x -144*x^2 +72*x^3)*exp(-2*x)). - _G. C. Greubel_, Mar 31 2021

%F a(n) = - 7*a(n-1) - 16*a(n-2) - 8*a(n-3) + 16*a(n-4) + 16*a(n-5). - _Wesley Ivan Hurt_, Mar 31 2021

%e a(3) = 0^3*2^0 - 1^3*2^1 + 2^3*2^2 - 3^3*2^3 = -186.

%p A232602:= n-> 2*(1 -(-2)^n*(1 +3*n -9*n^2 -9*n^3))/27; seq(A232602(n), n=0..35); # _G. C. Greubel_, Mar 31 2021

%t LinearRecurrence[{-7,-16,-8,16,16}, {0,-2,30,-186,838}, 40] (* _G. C. Greubel_, Mar 31 2021 *)

%o (PARI) a(n)=((-1)^n*2^(n+1)*(27*n^3+27*n^2-9*n-3)+6)/81;

%o (Magma) [2*(1 -(-2)^n*(1 +3*n -9*n^2 -9*n^3))/27: n in [0..35]]; // _G. C. Greubel_, Mar 31 2021

%o (Sage) [2*(1 -(-2)^n*(1 +3*n -9*n^2 -9*n^3))/27 for n in (0..35)] # _G. C. Greubel_, Mar 31 2021

%Y Cf. A059841 (p=0,q=-1), A130472 (p=1,q=-1), A089594 (p=2,q=-1), A232599 (p=3,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), A232603 (p=2,q=-1/2), A232604 (p=3,q=-1/2).

%K sign,easy

%O 0,2

%A _Stanislav Sykora_, Nov 27 2013