OFFSET
3,2
COMMENTS
a(n) is the number of ternary strings of length n with at least one 0, at least two 1's, and one 2.
LINKS
Index entries for linear recurrences with constant coefficients, signature (7,-19,25,-16,4).
FORMULA
G.f.: 2*x^4*(6 - 17*x + 14*x^2 - 4*x^3)/((1 - x)^3*(1 - 2*x)^2). - Stefano Spezia, Mar 14 2021
EXAMPLE
a(6)=150 since the strings are the 30 permutations of 201111, the 60 permutations of 200111 and the 60 permutations of 200011.
MATHEMATICA
Array[# (2^(# - 1) - # - 1) &, 30, 3] (* Michael De Vlieger, Mar 13 2021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Mar 13 2021
STATUS
approved