OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..677
Wikipedia, Partition of a set
FORMULA
a(n) = A124327(n,n).
EXAMPLE
a(0) = 1: the empty partition.
a(1) = 1: 1.
a(2) = 0.
a(3) = 2: 13|2, 1|23.
a(4) = 2: 124|3, 12|34.
a(5) = 2: 1235|4, 123|45.
a(6) = 29: 12346|5, 1234|56, 1456|2|3, 145|26|3, 145|2|36, 146|25|3, 14|256|3, 14|25|36, 146|2|35, 14|26|35, 14|2|356, 156|24|3, 15|246|3, 15|24|36, 16|245|3, 1|2456|3, 1|245|36, 16|24|35, 1|246|35, 1|24|356, 156|2|34, 15|26|34, 15|2|346, 16|25|34, 1|256|34, 1|25|346, 16|2|345, 1|26|345, 1|2|3456.
MAPLE
b:= proc(n, i, t, m) option remember; `if`(n=0, t^(m-i+1),
`if`((i+m)*(m+1-i)/2<n or i>n, 0, `if`(t=0, 0,
t*b(n, i+1, t, m))+ b(n-i, i+1, t+1, m)))
end:
a:= n-> b(n, 1, 0, n):
seq(a(n), n=0..42);
MATHEMATICA
b[n_, i_, t_, m_] := b[n, i, t, m] = If[n == 0, t^(m - i + 1),
If[(i + m)*(m + 1 - i)/2 < n || i > n, 0, If[t == 0, 0,
t*b[n, i + 1, t, m]] + b[n - i, i + 1, t + 1, m]]];
a[n_] := If[n == 0, 1, b[n, 1, 0, n]];
Table[a[n], {n, 0, 42}] (* Jean-François Alcover, Jun 10 2024, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 16 2023
STATUS
approved