OFFSET
0,2
COMMENTS
a(n) is also the number of length n ternary words with at least 4 0-digits between any other digits.
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n>=9, 3*a(n-9) equals the number of 3-colored compositions of n with all parts >=5, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
D. Birmajer, J. B. Gil, M. D. Weiner, On the Enumeration of Restricted Words over a Finite Alphabet, J. Int. Seq. 19 (2016) # 16.1.3, Example 9.
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,2).
FORMULA
G.f.: ( -1-2*x-2*x^2-2*x^3-2*x^4 ) / ( -1+x+2*x^5 ). - R. J. Mathar, Aug 04 2019
G.f.: Q(0)/(2*x^4) -1/x -1/x^2 -1/x^3 -1/x^4, where Q(k) = 1 + 1/(1 - x*(2*k+1 + 2*x^4)/( x*(2*k+2 + 2*x^4) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 29 2013
a(n) = 2n+1 if n<=5, else a(n) = a(n-1) + 2a(n-5). - Milan Janjic, Mar 09 2015
MAPLE
a:= proc(k::nonnegint) local n, i, j; if k=0 then unapply(3^n, n) else unapply((Matrix(k+1, (i, j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1, 1], n) fi end(4): seq(a(n), n=0..54);
MATHEMATICA
Series[1/(1-x-2*x^5), {x, 0, 54}] // CoefficientList[#, x]& // Drop[#, 4]& (* Jean-François Alcover, Feb 13 2014 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Aug 16 2008
STATUS
approved