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.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (9,-31,51,-40,12).
FORMULA
a(n) = 3^n - 2^n - n*2^(n-1) + n.
G.f.: x*(1 - 6*x + 14*x^2 - 11*x^3)/((1 - x)^2*(1 - 2*x)^2*(1 - 3*x)). - Andrew Howroyd, Nov 16 2025
a(n) ~ 3^n. - Charles R Greathouse IV, May 31 2026
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 *)
PROG
(PARI) a(n)=3^n-(n+2)*2^n/2+n \\ Charles R Greathouse IV, May 31 2026
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Enrique Navarrete, Feb 12 2023
STATUS
approved
