OFFSET
0,4
COMMENTS
A strict composition of n is a finite sequence of distinct positive integers summing to n.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..5000
FORMULA
MAPLE
b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0,
`if`(n=0, combinat[bell](p)*p!, b(n, i-1, p)+
b(n-i, min(n-i, i-1), p+1)))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..40); # Alois P. Heinz, Jul 30 2020
MATHEMATICA
Table[Sum[BellB[Length[ctn]], {ctn, Join@@Permutations/@Select[ IntegerPartitions[n], UnsameQ@@#&]}], {n, 0, 10}]
(* Second program: *)
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n == 0,
BellB[p]*p!, b[n, i-1, p] + b[n-i, Min[n-i, i-1], p+1]]];
a[n_] := b[n, n, 0];
a /@ Range[0, 40] (* Jean-François Alcover, May 21 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jul 16 2020
STATUS
approved