A099787 a(n) = Sum_{k=0..floor(n/4)} C(n-k,3*k) * 2^k * 3^(n-4*k).
1, 3, 9, 27, 83, 267, 909, 3267, 12235, 46983, 182529, 711099, 2764619, 10704147, 41257341, 158371011, 605932099, 2312728095, 8812918161, 33549513579, 127652354627, 485608571547, 1847326271949, 7028217617859, 26742885359131
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (9,-27,27,2).
Programs
-
GAP
a:=[1,3,9,27];; for n in [5..30] do a[n]:=9*a[n-1]-27*a[n-2] + 27*a[n-3] +2*a[n-4]; od; a; # G. C. Greubel, Sep 04 2019
-
Magma
I:=[1,3,9,27]; [n le 4 select I[n] else 9*Self(n-1) - 27*Self(n-2) + 27*Self(n-3) + 2*Self(n-4): n in [1..30]]; // G. C. Greubel, Sep 04 2019
-
Maple
seq(coeff(series((1-3*x)^2/((1-3*x)^3 - 2*x^4), x, n+1), x, n), n = 0..30); # G. C. Greubel, Sep 04 2019
-
Mathematica
LinearRecurrence[{9,-27,27,2}, {1,3,9,27}, 30] (* G. C. Greubel, Sep 04 2019 *)
-
PARI
my(x='x+O('x^30)); Vec((1-3*x)^2/((1-3*x)^3 - 2*x^4)) \\ G. C. Greubel, Sep 04 2019
-
Sage
def A099787_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P((1-3*x)^2/((1-3*x)^3 - 2*x^4)).list() A099787_list(30) # G. C. Greubel, Sep 04 2019
Formula
G.f.: (1-3*x)^2/((1-3*x)^3 - 2*x^4).
a(n) = 9*a(n-1) - 27*a(n-2) + 27*a(n-3) + 2*a(n-4).
Comments