OFFSET
0,2
COMMENTS
a(n) equals the number of n-length words on {0,1,2} such that 0 appears only in a run whose length is a multiple of 5. - 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 (2,0,0,0,1).
FORMULA
G.f.: 1/(1-2*x-x^5).
a(n) = Sum_{k=0..floor(n/4)} Sum_{i=0..n} binomial(n-4k, i)binomial(i, k).
G.f.: G(0), where G(k)= 1 + x*(2+x^4)/(1 - x*(2+x^4)/(x*(2+x^4) + 1/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jul 03 2013
Lim_{n->infinity} a(n)/a(n+1) = 0.486389... is a real root of -1 + 2Z + Z^5 = 0. - Sergei N. Gladkovskii, Jul 03 2013
MATHEMATICA
CoefficientList[Series[1/(1-2*x-x^5), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, 0, 0, 0, 1}, {1, 2, 4, 8, 16}, 50] (* G. C. Greubel, Feb 03 2018 *)
PROG
(PARI) x='x+O('x^30); Vec(1/(1-2*x-x^5)) \\ G. C. Greubel, Feb 03 2018
(Magma) I:=[1, 2, 4, 8, 16]; [n le 5 select I[n] else 2*Self(n-1) +Self(n-5): n in [1..30]]; // G. C. Greubel, Feb 03 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Sep 16 2004
STATUS
approved