login
The number of set partitions of {1,2,...,n} into a prime number of blocks each of which contains a prime number of elements.
1

%I #10 Sep 17 2015 17:13:06

%S 3,10,25,126,336,694,3711,22935,155628,789009,4133207,26216386,

%T 172746848,1257901128,8859163896,63208414749,453778734700,

%U 3084827391031,21322774479601,144228129141558,982574515258416,7457862499069701,62895482731826525,635323164540457770

%N The number of set partitions of {1,2,...,n} into a prime number of blocks each of which contains a prime number of elements.

%H Alois P. Heinz, <a href="/A190529/b190529.txt">Table of n, a(n) for n = 4..500</a>

%F E.g.f.: A(A(x)) where A(x) = Sum_{p=prime} x^p/p!.

%p with(combinat): with(numtheory):

%p b:= proc(n, i, m) option remember; `if`(n=0, `if`(isprime(m), 1, 0),

%p `if`(i<1, 0, (p-> add(multinomial(n, n-p*j, p$j)/j!*

%p b(n-p*j, i-1, m+j), j=0..n/p))(ithprime(i))))

%p end:

%p a:= n-> b(n, pi(n), 0):

%p seq(a(n), n=4..30); # _Alois P. Heinz_, Sep 17 2015

%t a= Table[Prime[n],{n,1,25}]; b[x_]:= Sum[x^i/i!,{i,a}]; Range[0,25]! CoefficientList[Series[b[b[x]],{x,0,25}],x]

%K nonn

%O 4,1

%A _Geoffrey Critzer_, May 11 2011