A182121 Primes p such that the sum of both three and five consecutive primes starting with p is prime.
5, 7, 11, 19, 29, 31, 53, 67, 79, 109, 149, 157, 163, 211, 229, 311, 349, 379, 401, 409, 449, 467, 653, 757, 809, 839, 857, 863, 883, 983, 997, 1033, 1087, 1103, 1187, 1193, 1289, 1301, 1303, 1409, 1481, 1523, 1553, 1637, 1663, 1669, 1709, 1951, 1973
Offset: 1
Keywords
Examples
5 is in the sequence because 5 + 7 + 11 = 23 is prime and 5 + 7 + 11 + 13 + 17 = 53 is also prime.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
cpQ[n_]:=Module[{ppi=PrimePi[n],cnsc},cnsc=Prime[Range[ppi,ppi+4]];And@@ PrimeQ[ {Total[cnsc],Total[Take[cnsc,3]]}]]; Select[Prime[Range[300]],cpQ] (* Harvey P. Dale, Mar 28 2013 *) Select[Partition[Prime[Range[500]],5,1],AllTrue[{Total[Take[#,3]],Total[#]},PrimeQ]&][[;;,1]] (* Harvey P. Dale, Feb 11 2024 *)
-
PARI
{a=2;b=3;c=5;d=7;e=11;for(n=1,300,s=a+b+c+d+e; if(isprime(s)&&isprime(a+b+c),print1(a","));a=b;b=c;c=d;d=e;e=nextprime(e+2))}