OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..300
Wikipedia, Partition of a set
EXAMPLE
a(3) = 4: 123, 12|3, 1|23, 1|2|3.
a(4) = 9: 1234, 123|4, 12|34, 12|3|4, 1|234, 1|23|4, 14|2|3, 1|2|34, 1|2|3|4.
MAPLE
b:= proc(n, i, m) option remember; `if`(n=0, 1, add(
`if`(j=i-1, 0, b(n-1, j, max(m, j))), j=1..m+1))
end:
a:= n-> b(n, 1, 0):
seq(a(n), n=0..25);
MATHEMATICA
b[n_, i_, m_] := b[n, i, m] = If[n == 0, 1, Sum[If[j == i - 1, 0, b[n - 1, j, Max[m, j]]], {j, 1, m + 1}]];
a[n_] := b[n, 1, 0];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, May 27 2018, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Mar 26 2016
STATUS
approved