OFFSET
0,2
COMMENTS
a(n) equals the number of n-length words on {0,1,2,3,4} such that 0 appears only in a run which length is a multiple of 4. - Milan Janjic, Feb 17 2015
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,0,0,1).
FORMULA
G.f.: 1/(1-4*x-x^4).
a(n) = Sum_{k=0..floor(n/3)} binomial(n-3*k, k) * 4^(n-4*k).
MAPLE
K:=1/(1+4*z-z^4): Kser:=series(K, z=0, 30): seq(abs(coeff(Kser, z, n)), n= 0..23); # Zerinvary Lajos, Nov 08 2007
MATHEMATICA
CoefficientList[Series[1/(1 - 4*x - x^4), {x, 0, 25}], x] (* Zerinvary Lajos, Mar 29 2007 *)
LinearRecurrence[{4, 0, 0, 1}, {0, 1, 4, 16}, 30] (* Harvey P. Dale, Jul 22 2014 *)
PROG
(PARI) x='x+O('x^30); Vec(1/(1-4*x-x^4)) \\ G. C. Greubel, Feb 03 2018
(Magma) I:=[0, 1, 4, 16]; [n le 4 select I[n] else 4*Self(n-1) +Self(n-4): n in [1..30]]; // G. C. Greubel, Feb 03 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Sep 16 2004
STATUS
approved