OFFSET
4,2
COMMENTS
a(n) is the number of ternary strings of length n with at least one 0, at least two 1's, and two 2's.
LINKS
Index entries for linear recurrences with constant coefficients, signature (10,-42,96,-129,102,-44,8).
FORMULA
G.f.: x^5*(30 - 150*x + 285*x^2 - 262*x^3 + 124*x^4 - 24*x^5)/((1 - x)^4*(1 - 2*x)^3). - Stefano Spezia, Mar 14 2021
EXAMPLE
a(7)=525 since the strings are the 210 permutations of 2211000, the 210 permutations of 2211100 and the 105 permutations of 2211110.
MATHEMATICA
Array[Binomial[#, 2] (2^(# - 2) - #) &, 28, 4] (* Michael De Vlieger, Mar 13 2021 *)
LinearRecurrence[{10, -42, 96, -129, 102, -44, 8}, {0, 30, 150, 525, 1568, 4284, 11070}, 30] (* Harvey P. Dale, May 17 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Mar 13 2021
STATUS
approved