OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..576
Wikipedia, Partition of a set
EXAMPLE
a(1) = 1: 1.
a(2) = 1: 12.
a(3) = 2: 123, 1|23.
a(4) = 5: 1234, 12|34, 13|24, 14|23, 1|234.
a(5) = 15: 12345, 123|45, 124|35, 125|34, 12|345, 134|25, 135|24, 13|245, 145|23, 14|235, 15|234, 1|2345, 1|23|45, 1|24|35, 1|25|34.
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, i+1)*
binomial(n-1, j-1), j=`if`(isprime(i), 2, 1)..n))
end:
a:= n-> b(n, 1):
seq(a(n), n=0..32);
MATHEMATICA
b[n_, i_] := b[n, i] = If[n==0, 1, Sum[b[n-j, i+1] Binomial[n-1, j-1], {j, If[PrimeQ[i], 2, 1], n}]];
a[n_] := b[n, 1];
a /@ Range[0, 32] (* Jean-François Alcover, May 08 2020, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 12 2020
STATUS
approved