OFFSET
0,9
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..5000
Wikipedia, Partition of a set
EXAMPLE
a(11) = 6: 123|4, 124|3, 13|24, 14|23, 1|2|34, 1|2345.
MAPLE
b:= proc(n, m) option remember; `if`(n=0, 1,
b(n-1, m)*m + expand(x^n*b(n-1, m+1)))
end:
a:= n-> add(coeff(b(n-k, 0), x, k), k=ceil(n/2)..n):
seq(a(n), n=0..80);
# second Maple program:
b:= proc(n, i, t) option remember; `if`(i*(i+1)/2<n, 0,
`if`(n=0, t^i, `if`(t=0, 0, t*b(n, i-1, t))+
(t+1)^max(0, 2*i-n-1)*b(n-i, min(n-i, i-1), t+1)))
end:
a:= n-> add(b(k, n-k, 0), k=ceil(n/2)..n):
seq(a(n), n=0..80);
MATHEMATICA
b[n_, i_, t_] := b[n, i, t] = If[i*(i + 1)/2 < n, 0, If[n == 0, t^i, If[t == 0, 0, t*b[n, i - 1, t]] + (t + 1)^Max[0, 2*i - n - 1]*b[n - i, Min[n - i, i - 1], t + 1]]];
a[n_] := If[n == 0, 1, Sum[b[k, n - k, 0], {k, Ceiling[n/2], n}]];
Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Oct 03 2024, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 11 2023
STATUS
approved