A332248 Number of set partitions of [n] where all prime-indexed blocks are not singletons.
1, 1, 1, 2, 5, 15, 60, 286, 1423, 7185, 37758, 212596, 1293577, 8415869, 57715274, 414520958, 3125102795, 24880061105, 209909409566, 1871945790360, 17503956383037, 169851122851049, 1694189515772750, 17248694322541778, 178473482993477591, 1873036127628583885
Offset: 0
Keywords
Examples
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.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..576
- Wikipedia, Partition of a set
Programs
-
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 *)