OFFSET
0,3
COMMENTS
For k>2, a(n,k)=k^(n+1)/((k-2)(k+1))-2^(n+1)/(3k-6)-(-1)^n/(3k+3) gives the convolution of Jacobsthal(n) and k^n.
In general x/((1-ax)(1-ax-bx^2)) expands to Sum_{k=0..floor(n/2)} C(n-k,k+1)a^(n-k-1)*(b/a)^k. - Paul Barry, Oct 25 2004
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-1,-6).
FORMULA
G.f.: x/((1+x)*(1-2*x)*(1-3*x)).
a(n) = (3^(n+2) - 2^(n+3) - (-1)^n)/12.
a(n) = 4*a(n-1) -a(n-2) -6*a(n-3).
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k+1)*2^(n-k-1)*(3/2)^k. - Paul Barry, Oct 25 2004
a(n) = (3^(n+1) - A001045(n+3))/4. - G. C. Greubel, Jul 21 2022
MATHEMATICA
LinearRecurrence[{4, -1, -6}, {0, 1, 4}, 30] (* Harvey P. Dale, Apr 02 2017 *)
Jacob0[n_] := (2^n - (-1)^n)/3; a[n_] := First@ListConvolve[Table[Jacob0[i], {i, 0, n}], 3^Range[0, n]]; Table[a[x], {x, 0, 10}] (* Robert P. P. McKone, Nov 28 2020 *)
PROG
(PARI) concat(0, Vec(x/((1+x)*(1-2*x)*(1-3*x)) + O(x^50))) \\ Michel Marcus, Sep 13 2014
(Magma) [(3^(n+2) -2^(n+3) -(-1)^n)/12: n in [0..50]]; // G. C. Greubel, Jul 21 2022
(SageMath) [(3^(n+1) - lucas_number1(n+3, 1, -2))/4 for n in (0..50)] # G. C. Greubel, Jul 21 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 21 2004
STATUS
approved