A099785 a(n) = Sum_{k=0..floor(n/4)} C(n-k,3*k) * 2^(n-3*k).
1, 2, 4, 8, 18, 48, 144, 448, 1380, 4152, 12224, 35456, 102024, 292768, 840416, 2416384, 6959504, 20069280, 57913536, 167158656, 482462752, 1392319488, 4017460224, 11590946816, 33439639616, 96470796672, 278311599616
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (6,-12,8,2).
Programs
-
GAP
a:=[1,2,4,8];; for n in [5..30] do a[n]:=6*a[n-1] -12*a[n-2] + 8*a[n-3] +2*a[n-4]; od; a; # G. C. Greubel, Sep 04 2019
-
Magma
I:=[1,2,4,8]; [n le 4 select I[n] else 6*Self(n-1) - 12*Self(n-2) + 8*Self(n-3) + 2*Self(n-4): n in [1..30]]; // G. C. Greubel, Sep 04 2019
-
Maple
seq(coeff(series((1-2*x)^2/((1-2*x)^3 - 2*x^4), x, n+1), x, n), n = 0 .. 40); # G. C. Greubel, Sep 04 2019
-
Mathematica
Table[Sum[Binomial[n-k,3k]2^(n-3k),{k,0,Floor[n/4]}],{n,0,30}] (* or *) LinearRecurrence[{6,-12,8,2},{1,2,4,8},30] (* Harvey P. Dale, Apr 01 2012 *)
-
PARI
my(x='x+O('x^30)); Vec((1-2*x)^2/((1-2*x)^3 - 2*x^4)) \\ G. C. Greubel, Sep 04 2019
-
Sage
def A099785_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P((1-2*x)^2/((1-2*x)^3 - 2*x^4)).list() A099785_list(30) # G. C. Greubel, Sep 04 2019
Formula
G.f.: (1-2*x)^2/((1-2*x)^3 - 2*x^4).
a(n) = 6*a(n-1) - 12*a(n-2) + 8*a(n-3) + 2*a(n-4).
Comments