OFFSET
0,3
COMMENTS
a(n) is the number of ordered set partitions of an n-set into 2 sets such that the first set has either 3, 2, 1 or no elements, the second set has no restrictions, and an element is selected from the second set.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
E.g.f.: (1 + x + x^2/2 + x^3/6)*x*exp(x).
From Stefano Spezia, Mar 04 2023: (Start)
O.g.f.: x*(1 - x + 2*x^2 + 2*x^3)/(1 - x)^5.
EXAMPLE
The 294 set partitions for n=7 are the following (where the element selected from the second set is in parentheses):
{ }, {(1),2,3,4,5,6,7} (7 of these);
{1}, {(2),3,4,5,6,7} (42 of these);
{1,2}, {(3),4,5,6,7} (105 of these);
{1,2,3}, {(4),5,6,7} (140 of these).
MATHEMATICA
Table[n^2*(n*(n - 3) + 8)/6, {n, 0, 50}] (* Paolo Xausa, Jun 10 2024 *)
PROG
(Python)
def A361099(n): return n**2*(n*(n - 3) + 8)//6 # Chai Wah Wu, Mar 24 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Mar 01 2023
STATUS
approved