OFFSET
0,4
COMMENTS
a(n) is the number of strings of length n defined on {0, 1, 2, 3} that have exactly two 2's, zero or two 3's, and have no restriction on the number of 0's and 1's.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (10,-40,80,-80,32).
FORMULA
E.g.f.: exp(2*x)*(x^2/2 + x^4/4).
G.f.: x^2*(1 - 4*x + 10*x^2)/(1 - 2*x)^5. - Stefano Spezia, May 23 2025
EXAMPLE
a(4) = 30 since the strings are the 6 permutations of 2233, the 6 permutations of 1122, the 6 permutations of 0022, and the 12 permutations of 0122.
MATHEMATICA
LinearRecurrence[{10, -40, 80, -80, 32}, {0, 0, 1, 6, 30}, 30] (* Paolo Xausa, May 27 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, May 23 2025
STATUS
approved
