OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..575
Wikipedia, Partition of a set
EXAMPLE
a(4) = 17 = 3*1 + 4*2 + 2*3: 432(1), 42(1)|3, 4(1)|3|2, 43|(2)1, 43|(2)|1, 4|3(2)1, 4|3(2)|1, 43(1)|(2), 4(1)|3(2).
MAPLE
b:= proc(n, m) option remember; `if`(n=0, [1, 0], add((p-> [0,
`if`(n=j, p[1]*j, 0)]+p)(b(n-1, max(m, j))), j=1..m+1))
end:
a:= n-> b(n, 0)[2]:
seq(a(n), n=0..25);
MATHEMATICA
b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[With[{p = b[n-1, Max[m, j]]},
{0, If[n == j, p[[1]]*j, 0]} + p], {j, 1, m+1}]];
a[n_] := b[n, 0][[2]];
Table[a[n], {n, 0, 25}]; (* Jean-François Alcover, May 08 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 11 2022
STATUS
approved