login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A316185 Number of strict integer partitions of the n-th prime into a prime number of prime parts. 5

%I #16 Jun 11 2021 13:37:39

%S 0,0,1,1,0,1,0,2,2,3,5,5,6,8,10,13,18,20,26,32,34,45,54,66,90,106,117,

%T 135,142,165,269,311,375,398,546,579,689,823,938,1107,1301,1352,1790,

%U 1850,2078,2153,2878,3811,4241,4338,4828,5495,5637,7076,8000,9032

%N Number of strict integer partitions of the n-th prime into a prime number of prime parts.

%H Alois P. Heinz, <a href="/A316185/b316185.txt">Table of n, a(n) for n = 1..2000</a>

%F a(n) = A045450(A000040(n)).

%e The a(14) = 8 partitions of 43 into a prime number of distinct prime parts: (41,2), (31,7,5), (29,11,3), (23,17,3), (23,13,7), (19,17,7), (19,13,11), (17,11,7,5,3).

%p h:= proc(n) option remember; `if`(n=0, 0,

%p `if`(isprime(n), n, h(n-1)))

%p end:

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

%p `if`(isprime(c), 1, 0), `if`(i<2, 0, b(n, h(i-1), c)+

%p `if`(i>n, 0, b(n-i, h(min(n-i, i-1)), c+1))))

%p end:

%p a:= n-> b(ithprime(n)$2, 0):

%p seq(a(n), n=1..56); # _Alois P. Heinz_, May 26 2021

%t Table[Length[Select[IntegerPartitions[Prime[n]],And[UnsameQ@@#,PrimeQ[Length[#]],And@@PrimeQ/@#]&]],{n,10}]

%t (* Second program: *)

%t h[n_] := h[n] = If[n == 0, 0, If[PrimeQ[n], n, h[n - 1]]];

%t b[n_, i_, c_] := b[n, i, c] = If[n == 0,

%t If[PrimeQ[c], 1, 0], If[i < 2, 0, b[n, h[i - 1], c] +

%t If[i > n, 0, b[n - i, h[Min[n - i, i - 1]], c + 1]]]];

%t a[n_] := b[Prime[n], Prime[n], 0];

%t Array[a, 56] (* _Jean-François Alcover_, Jun 11 2021, after _Alois P. Heinz_ *)

%o (PARI) seq(n)={my(p=vector(n, k, prime(k))); my(v=Vec(prod(k=1, n, 1 + x^p[k]*y + O(x*x^p[n])))); vector(n, k, sum(i=1, k, polcoeff(v[1+p[k]], p[i])))} \\ _Andrew Howroyd_, Jun 26 2018

%Y Cf. A000586, A000607, A038499, A045450, A056768, A064688, A070215, A085755, A302590, A316092, A316153, A316154.

%K nonn

%O 1,8

%A _Gus Wiseman_, Jun 25 2018

%E More terms from _Alois P. Heinz_, Jun 26 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 12:36 EDT 2024. Contains 371711 sequences. (Running on oeis4.)