login
A384415
a(n) = 4^n - 3^n - n*3^(n-1) - binomial(n,2)*3^(n-2).
0
0, 0, 0, 1, 13, 106, 694, 3991, 21067, 104680, 497452, 2285053, 10222777, 44788342, 192970834, 820244467, 3448381783, 14367483412, 59421385000, 244271688313, 999169721125, 4070288777410, 16525230017710, 66906367267471, 270271938430243
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.
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
Sequence in context: A030055 A155636 A055902 * A295249 A295648 A218093
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, May 28 2025
STATUS
approved