login
A389989
a(n) = 3^n - 2^n - 2*n - 1, n > 1; a(0)=a(1)=0.
1
0, 0, 0, 12, 56, 200, 652, 2044, 6288, 19152, 58004, 175076, 527320, 1586104, 4766556, 14316108, 42981152, 129009056, 387158308, 1161737140, 3485735784, 10458256008, 31376865260, 94134790172, 282412759216, 847255054960, 2541798719412, 7625463267204, 22876524019448, 68629840493912
OFFSET
0,4
COMMENTS
Number of ternary strings of length n such that the number of 0's and 1's in total is at least two and there is at least one 2. For example, a(3)=12 since the strings are (number of permutations in parentheses): 002 (3), 112 (3), 012 (6).
Also the number of ordered set partitions of an n-set into 3 sets such that the number of elements in the first and second sets in total is at least two and the third set has at least one element.
FORMULA
E.g.f.: (exp(x)-1)*(exp(2*x)-2*x-1).
G.f.: 4*x^3*(3 - 7*x + 3*x^2)/((1 - x)^2*(1 - 2*x)*(1 - 3*x)). - Andrew Howroyd, Nov 06 2025
EXAMPLE
a(3)=12 since the ordered set partitions are: {1,2}{ }{3}, {1,3}{ }{2}, {2,3}{ }{1}, { }{1,2}{3}, { }{1,3}{2}, { }{2,3}{1}, {1}{2}{3}, {1}{3}{2}, {2}{1}{3}, {2}{3}{1}, {3}{1}{2}, {3}{2}{1}.
MATHEMATICA
a[n_] := 3^n - 2^n - 2*n - 1; a[0] = a[1] = 0; Array[a, 30, 0] (* Amiram Eldar, Oct 21 2025 *)
CROSSREFS
Sequence in context: A009430 A348584 A035289 * A275505 A009827 A068418
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Oct 21 2025
STATUS
approved