OFFSET
0,6
LINKS
Wikipedia, Partition of a set
EXAMPLE
a(0) = 1: the empty partition.
a(2) = 1: 12.
a(4) = 1: 134|2.
a(5) = 4: 1245|3, 1|2345, 14|25|3, 15|24|3.
a(6) = 12: 12356|4, 12|3456, 13|25|46, 13|26|45, 15|23|46, 16|23|45, 14|2|356, 1|245|36, 1|246|35, 156|2|34, 1|25|346, 1|26|345.
MAPLE
b:= proc(n, m, s) option remember;
`if`(n=0, `if`(add(i, i=m)*2=s, 1, 0),
add(b(n-1, subs(j=n, m), s), j=m)+
b(n-1, {m[], n}, s+n))
end:
a:= n-> b(n, {}, 0):
seq(a(n), n=0..15);
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Alois P. Heinz, Dec 15 2023
STATUS
approved