login
A152470
Largest of three consecutive primes whose sum is a prime.
7
11, 13, 17, 23, 29, 31, 37, 41, 47, 61, 71, 73, 79, 89, 97, 107, 127, 151, 157, 167, 173, 211, 227, 239, 281, 293, 307, 311, 317, 349, 353, 359, 389, 401, 419, 421, 439, 461, 463, 479, 487, 503, 509, 523, 563, 631, 647, 661, 673, 677, 719, 733, 757, 761, 769
OFFSET
1,1
EXAMPLE
3+5+7 = 15 is composite.
5+7+11 = 23 is prime and (5, 7, 11) are consecutive primes so a(1) = 11.
MAPLE
Primes:= select(isprime, [2, (2*i+1 $ i=1..10000)]):
Primes[select(t -> isprime(Primes[t-2]+Primes[t-1]+Primes[t]), [$3..nops(Primes)])];
# Robert Israel, Aug 29 2014
MATHEMATICA
lst={}; Do[p0=Prime[n]; p1=Prime[n+1]; p2=Prime[n+2]; If[PrimeQ[p0+p1+p2], AppendTo[lst, p2]], {n, 6!}]; lst
PROG
(PFGW & SCRIPT)
SCRIPT
DIM n, 0
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
PRP p(n)+p(n+1)+p(n+2)
IF ISPRP then GOTO a
GOTO loop1
LABEL a
WRITE myf, t
GOTO loop1
# Pierre CAMI, Aug 30 2014
(PARI) s=[]; for(n=1, 1000, if(isprime(prime(n)+prime(n+1)+prime(n+2)), s=concat(s, prime(n+2)))); s \\ Colin Barker, Aug 25 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved