%I #17 Oct 19 2017 03:14:58
%S 53,59,67,83,113,151,157,211,239,601,809,821,881,971,1237,1297,1427,
%T 1669,1759,1973,2069,2129,2243,2333,2659,2677,2719,2789,2803,2999,
%U 3329,3613,3623,3769,3797,4001,4451
%N Primes which have a prime number of partitions into five distinct primes.
%C The corresponding numbers of partitions are 2,5,11,29,109,331,379,1091...
%H Charles R Greathouse IV, <a href="/A112418/b112418.txt">Table of n, a(n) for n = 1..102</a>
%e 53 is there because there are 2 partitions of 53 (3+7+11+13+19, 5+7+11+13+17) and 2 is prime.
%p part5_prime:=proc(N) s:=1; for n from 2 to N do cont:=0; for i from 1 to n-5 do for j from i+1 to n-4 do for k from j+1 to n-3 do for l from k+1 to n-2 do for m from l+1 to n-1 do if(ithprime(n)= ithprime(i)+ithprime(j)+ithprime(k)+ithprime(l)+ithprime(m) then cont:=cont+1; fi; od; od; od; od; od; if (isprime(cont)=true) then a[s]:=ithprime(n); s:=s+1; fi; od; end:
%o (PARI) has(n)=my(t,Q,R,S);forprime(p=n\5+1,n-26, Q=n-p; forprime(q=Q\4+1,min(p-1,Q-15), R=Q-q; forprime(r=R\3+1,min(q-1,R-8), S=R-r; forprime(s=S-r+1,(S-1)\2, isprime(S-s) && t++)))); isprime(t)
%o select(has, primes(100)) \\ _Charles R Greathouse IV_, Apr 22 2015
%o (PARI) list(lim)=my(v=vectorsmall(precprime(lim)),u=List(),Q,R,S); forprime(p=13,#v-26, Q=#v-p; forprime(q=11,min(p-1,Q-15), R=Q-q; forprime(r=7,min(q-1,R-8), S=R-r; forprime(s=5,min(S-2,r-1), forprime(t=3,min(S-s,s-1), v[p+q+r+s+t]++))))); forprime(p=2,lim, if(isprime(v[p]), listput(u,p))); Set(u) \\ _Charles R Greathouse IV_, Apr 22 2015
%Y Cf. A000009, A000041, A007963, A051034.
%K nonn
%O 1,1
%A _Giorgio Balzarotti_ and _Paolo P. Lava_, Dec 09 2005
%E Edited by _Don Reble_, Jan 26 2006
%E a(31)-a(37) from _Charles R Greathouse IV_, Apr 22 2015