OFFSET
0,5
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..577
Wikipedia, Partition of a set
FORMULA
a(n) = A370945(n,n).
EXAMPLE
a(0) = 1: the empty partition.
a(1) = 1: 1.
a(3) = 1: 12|3.
a(4) = 2: 123|4, 1|24|3.
a(5) = 6: 1234|5, 12|34|5, 13|24|5, 14|23|5, 1|235|4, 145|2|3.
a(6) = 20: 12345|6, 123|45|6, 124|35|6, 125|34|6, 12|345|6, 134|25|6, 135|24|6, 13|245|6, 1356|2|4, 13|2|4|56, 145|23|6, 14|235|6, 15|234|6, 1|2346|5, 1|23|46|5, 1|24|36|5, 1|26|34|5, 15|2|36|4, 16|2|35|4, 1|2|3|456.
MAPLE
h:= proc(n) option remember; `if`(n=0, 1,
add(h(n-j)*binomial(n-1, j-1), j=2..n))
end:
b:= proc(n, i, m) option remember; `if`(n>i*(i+1)/2, 0,
`if`(n=0, h(m), b(n, i-1, m)+b(n-i, min(n-i, i-1), m-1)))
end:
a:= n-> b(n$3):
seq(a(n), n=0..26);
MATHEMATICA
h[n_] := h[n] = If[n == 0, 1, Sum[h[n-j]*Binomial[n-1, j-1], {j, 2, n}]];
b[n_, i_, m_] := b[n, i, m] = If[n > i*(i + 1)/2, 0, If[n == 0, h[m], b[n, i - 1, m] + b[n - i, Min[n - i, i - 1], m - 1]]];
a[n_] := b[n, n, n];
Table[a[n], {n, 0, 26}] (* Jean-François Alcover, Mar 08 2024, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Mar 06 2024
STATUS
approved