OFFSET
0,3
COMMENTS
a(n) is the number of ordered set partitions of an n-set into 3 sets such that the first set has at least one element, the second set cannot have a single element, and the third set has no restrictions.
FORMULA
a(n) = 3^n - 2^n - n*2^(n-1) + n.
EXAMPLE
The 37 set partitions for n=4 are the following:
{1,2,3,4}, {}, {} (1 of these);
{1,2,3}, {}, {4} (4 of this type);
{1,2}, {}, {3,4} (6 of this type);
{1,2}, {3,4}, {} (6 of this type);
{1}, {2,3}, {4} (12 of this type);
{1}, {2,3,4}, {} (4 of this type);
{1}, {}, {2,3,4} (4 of this type).
MATHEMATICA
With[{nn=30}, CoefficientList[Series[Exp[x](Exp[x]-1)(Exp[x]-x), {x, 0, nn}], x] Range[0, nn]!] (* Harvey P. Dale, Apr 02 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Feb 12 2023
STATUS
approved