OFFSET
0,3
COMMENTS
a(n) is the number of strings of length n defined on {0, 1, 2, 3} that contain at least one 0, do not contain exactly one 1, do not contain exactly two 2s, and do not contain exactly three 3s.
FORMULA
a(n) = 4^n - 3^n - n*(3^(n-1) - 2^(n-1)) - binomial(n,2)*(3^(n-2) - 2^(n-2)) - binomial(n,3)*(3^(n-3) - 2^(n-1) + 3) + binomial(n,4)*(2^(n-2) - 4) + 5*binomial(n,5)*(2^(n-4) - 2) - 60*binomial(n,6) except at n = 6.
EXAMPLE
a(3)=19 since the strings are: 011 (3 of this type), 033 (3 of this type), 002 (3 of this type), 003 (3 of this type), 023 (6 of this type), and 000.
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Apr 26 2025
STATUS
approved
