OFFSET
1,1
COMMENTS
This sequence (obviously) uses the "strictly larger" variant 2 (A151800) of the nextprime() function, rather than A007918. - M. F. Hasler, Sep 09 2015
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
19 is a term since 19 + 23 = 42 is the sum of consecutive primes and also arithmetic mean of the twin primes 41 and 43.
MATHEMATICA
okQ[p_] := Module[{s = p + NextPrime[p]}, PrimeQ[s - 1] && PrimeQ[s + 1]]; Select[Prime[Range[1000]], okQ] (* Zak Seidov, Apr 10 2011 *)
PROG
(Magma) [n: n in PrimesUpTo(3330) | IsPrime(n+NextPrime(n)-1) and IsPrime(n+NextPrime(n)+1)]; // Bruno Berselli, Apr 10 2011
(PARI) is(n)=if(isprime(n), n+=nextprime(n+1); isprime(n-1) && isprime(n+1), 0) \\ Charles R Greathouse IV, Jul 01 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, Nov 17 2004
EXTENSIONS
Corrected and edited by Zak Seidov, Apr 10 2011
STATUS
approved