OFFSET
0,3
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2).
FORMULA
G.f.: (1 - 2*x + 4*x^2)/(1-2*x).
a(n) = Sum_{k=0..n} binomial(n,k)*(3^k - 2*k).
E.g.f.: exp(2*x) - 2*x. - G. C. Greubel, Dec 01 2019
MAPLE
seq( `if`(n<2, 1-n, 2^n), n=0..30); # G. C. Greubel, Dec 01 2019
MATHEMATICA
Table[If[n<2, 1-n, 2^n], {n, 0, 30}] (* G. C. Greubel, Dec 01 2019 *)
PROG
(PARI) vector(31, n, if(n<3, 2-n, 2^(n-1))) \\ G. C. Greubel, Dec 01 2019
(Magma) [n lt 2 select 1-n else 2^n: n in [0..30]]; // G. C. Greubel, Dec 01 2019
(Sage) [1, 0]+[2^n for n in (2..30)] # G. C. Greubel, Dec 01 2019
(GAP) Concatenation([1, 0], List([2..30], n-> 2^n )); # G. C. Greubel, Dec 01 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Mar 01 2011
STATUS
approved