A360586 Expansion of e.g.f.: exp(x)*(exp(x)-1)*(exp(x)-x).
0, 1, 3, 10, 37, 136, 479, 1618, 5289, 16876, 52915, 163846, 502781, 1532896, 4651911, 14070394, 42456913, 127894996, 384799067, 1156756462, 3475250085, 10436235976, 31330727983, 94038321250, 282211432697, 846835624636, 2540926304259, 7623651327958
Offset: 0
Keywords
Examples
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).
Programs
-
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 *)
Formula
a(n) = 3^n - 2^n - n*2^(n-1) + n.
Comments