A099784 a(n) = Sum_{k=0..floor(n/3)} C(n-k,2*k) * 2^k * (-2)^(n-3*k).
1, -2, 4, -6, 4, 16, -92, 312, -848, 1960, -3824, 5760, -3824, -15392, 88384, -299616, 814144, -1881344, 3669568, -5524608, 3657472, 14807680, -84909824, 287723520, -781639424, 1805843968, -3521371136, 5298829824
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (-4,-4,2).
Programs
-
GAP
a:=[1,-2,4];; for n in [4..30] do a[n]:=-4*a[n-1]-4*a[n-2] + 2*a[n-3]; od; a; # G. C. Greubel, Sep 04 2019
-
Magma
I:=[1,-2,4]; [n le 3 select I[n] else -4*Self(n-1) - 4*Self(n-2) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Sep 04 2019
-
Maple
seq(coeff(series((1-2*x)/((1-2*x)^2 - 2*x^3), x, n+1), x, n), n = 0 .. 30); # G. C. Greubel, Sep 04 2019
-
Mathematica
LinearRecurrence[{-4,-4,2}, {1,-2,4}, 30] (* G. C. Greubel, Sep 04 2019 *)
-
PARI
my(x='x+O('x^30)); Vec((1-2*x)/((1-2*x)^2 - 2*x^3)) \\ G. C. Greubel, Sep 04 2019
-
Sage
def A099784_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P((1-2*x)/((1-2*x)^2 - 2*x^3)).list() A099784_list(30) # G. C. Greubel, Sep 04 2019
Formula
G.f.: (1+2*x)/((1+2*x)^2 - 2*x^3).
a(n) = Sum_{k=0..floor(n/3)} C(n-k, 2*k)*2^(n-2*k)*(-1)^(n-3*k).
a(n) = -4*a(n-1) - 4*a(n-2) + 2*a(n-3).
Comments