OFFSET
0,2
LINKS
Stanislav Sykora, Table of n, a(n) for n = 0..1000
S. Sykora, Finite and Infinite Sums of the Power Series (k^p)(x^k), DOI 10.3247/SL1Math06.002, Section V.
Index entries for linear recurrences with constant coefficients, signature (-3,0,4).
FORMULA
a(n) = 2*( (3*n+1)*(-2)^n - 1 )/9.
From Bruno Berselli, Nov 28 2013: (Start)
G.f.: -2*x / ((1 - x)*(1 + 2*x)^2). [corrected by Georg Fischer, May 11 2019]
a(n) = -3*a(n-1) +4*a(n-3). (End)
From G. C. Greubel, Mar 31 2021: (Start)
E.g.f.: (2/9)*(-exp(x) + (1-6*x)*exp(-2*x)).
a(n) = 2*(-1)^n*A045883(n). (End)
EXAMPLE
a(3) = 0^1*2^0 - 1^1*2^1 + 2^1*2^2 - 3^1*2^3 = -18.
MAPLE
MATHEMATICA
Table[2((3n+1)(-2)^n -1)/9, {n, 0, 30}] (* Bruno Berselli, Nov 28 2013 *)
PROG
(PARI) a(n)=-((3*n+1)*(-2)^(n+1)+2)/9;
(Magma) [2*((-2)^n*(3*n+1) -1)/9: n in [0..30]]; // G. C. Greubel, Mar 31 2021
(Sage) [2*((-2)^n*(3*n+1) -1)/9 for n in (0..30)] # G. C. Greubel, Mar 31 2021
CROSSREFS
Cf. A045883, A140960 (absolute values), 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=q=2), A036827 (p=3, q=2), A077925 (p=0, q=-2), A232601 (p=2, q=-2), A232602 (p=3, q=-2), A232603 (p=2, q=-1/2), A232604 (p=3, q=-1/2).
Cf. A045883.
KEYWORD
sign,easy
AUTHOR
Stanislav Sykora, Nov 27 2013
STATUS
approved