OFFSET
0,4
COMMENTS
a(n) is the number of ternary strings of length n that contain either none or three 0's and either none or three 1's.
LINKS
Index entries for linear recurrences with constant coefficients, signature (7,-21,35,-35,21,-7,1).
FORMULA
E.g.f.: exp(x)*(1 + x^3/6)^2.
O.g.f.:(1 - 6*x + 15*x^2 - 18*x^3 + 9*x^4 + 19*x^6)/(1 - x)^7. - Stefano Spezia, Feb 19 2021
EXAMPLE
a(7)=211 since the strings are the 140 permutations of 0001112, the 35 permutations of 0002222, the 35 permutations of 1112222, and 2222222.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Feb 17 2021
STATUS
approved