OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
Wikipedia, Partition of a set
EXAMPLE
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-> max(coeffs(b(n, 0))):
seq(a(n), n=0..30);
# 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-> max(seq(b(k, n, 0), k=n..n*(n+1)/2)):
seq(a(n), n=0..30);
MATHEMATICA
b[n_, m_] := b[n, m] = If[n == 0, 1, b[n-1, m]*m + Expand[x^n*b[n-1, m+1]]];
a[n_] := Max[CoefficientList[b[n, 0], x]];
Table[a[n], {n, 0, 30}]
(* second program: *)
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, Max[Table[b[k, n, 0], { k, n, n*(n + 1)/2}]]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Dec 13 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Dec 06 2023
STATUS
approved