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