OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..707
Wikipedia, Partition of a set
EXAMPLE
a(3) = 1: 13|2.
a(4) = 1: 124|3.
a(5) = 4: 1235|4, 124|35, 125|34, 13|245.
a(6) = 11: 12346|5, 1235|46, 1236|45, 1256|34, 14|2356, 145|2|36, 14|256|3, 146|2|35, 15|246|3, 16|245|3, 156|2|34.
MAPLE
f:= proc(n) option remember; `if`(n<2, 1-n, (n-1)*(f(n-1)+f(n-2))) end:
a:= proc(m) option remember; local b; b:=
proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0,
`if`(n=0, p!*f(m-p), b(n, i-1, p)+b(n-i, min(n-i, i-1), p-1)/(i-1)!))
end: b(m$3)
end:
seq(a(n), n=0..30);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 17 2023
STATUS
approved