login
A344215
a(n) = n*(3^(n-1) - 2^(n-1)).
0
0, 0, 2, 15, 76, 325, 1266, 4655, 16472, 56745, 191710, 638275, 2101188, 6855485, 22205834, 71498775, 229058224, 730680145, 2322163638, 7356008555, 23234743580, 73200452325, 230081633122, 721667902015, 2259234965256, 7060318981625, 22028631430286, 68628565425555, 213512971483252
OFFSET
0,3
COMMENTS
a(n) is the number of quaternary strings of length n that contain one 0 and at least one 1.
For ternary strings with this property see A058877; for binary strings see A199969.
FORMULA
E.g.f.: x*(exp(3*x) - exp(2*x)).
G.f.: x^2*(2 - 5*x)/(1 - 5*x + 6*x^2)^2. - Stefano Spezia, May 12 2021
EXAMPLE
a(3)=15 since the strings are the 3 permutations of 011, the 6 permutations of 012 and the 6 permutations of 013.
MATHEMATICA
LinearRecurrence[{10, -37, 60, -36}, {0, 0, 2, 15}, 29] (* Amiram Eldar, May 11 2021 *)
Table[n(3^(n-1)-2^(n-1)), {n, 0, 30}] (* Harvey P. Dale, Mar 13 2022 *)
CROSSREFS
Sequence in context: A308914 A099743 A283842 * A102289 A041243 A216247
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, May 11 2021
STATUS
approved