OFFSET
0,5
COMMENTS
a(n) is the number of strings of length n defined on {0, 1, 2, 3} that contain at least three 0's.
LINKS
Index entries for linear recurrences with constant coefficients, signature (13,-63,135,-108).
FORMULA
E.g.f.: exp(3*x)*(exp(x) - x^2/2 - x - 1).
G.f.: x^3/((1 - 3*x)^3*(1 - 4*x)). - Stefano Spezia, May 29 2025
EXAMPLE
a(4) = 13 since the strings are the 4 permutations of 0001, the 4 permutations of 0002, the 4 permutations of 0003 and 0000.
MATHEMATICA
a[n_]:=4^n - 3^n - n*3^(n-1) - Binomial[n, 2]*3^(n-2); Array[a, 25, 0] (* Stefano Spezia, May 29 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, May 28 2025
STATUS
approved
