A098576 a(n) = Sum_{k=0..floor(n/4)} C(n-2*k,2*k) * 3^k.
1, 1, 1, 1, 4, 10, 19, 31, 55, 109, 220, 424, 793, 1489, 2845, 5473, 10480, 19954, 37963, 72391, 138259, 263989, 503608, 960400, 1831969, 3495505, 6669865, 12725425, 24276892, 46314874, 88362451, 168586303, 321640831, 613639981, 1170726484
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,-1,0,3).
Programs
-
Magma
I:=[1,1,1,1]; [n le 4 select I[n] else 2*Self(n-1) - Self(n-2) + 3*Self(n-4): n in [1..30]]; // G. C. Greubel, Feb 03 2018
-
Mathematica
Table[Sum[Binomial[n-2k,2k]3^k,{k,0,Floor[n/4]}],{n,0,40}] (* or *) LinearRecurrence[{2,-1,0,3},{1,1,1,1},40] (* Harvey P. Dale, Dec 04 2011 *)
-
PARI
x='x+O('x^30); Vec((1-x)/((1-x)^2-3*x^4)) \\ G. C. Greubel, Feb 03 2018
Formula
G.f.: (1-x)/((1-x)^2-3*x^4).
a(n) = 2*a(n-1) - a(n-2) + 3*a(n-4).