OFFSET
1,1
COMMENTS
Starting with 6 all terms are == 0 (mod 6). - Zak Seidov, Jan 04 2013
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
EXAMPLE
4 is in the sequence because the fourth prime is 7 and both 7+4 and 7-4 are primes.
MATHEMATICA
Select[ Range[ 4000 ], PrimeQ[ Prime[ # ] + # ] && PrimeQ[ Prime[ # ] - # ] & ]; Join[{4}, Select[ Range[6, 4000, 6 ], PrimeQ[Prime[ # ] + # ] && PrimeQ[ Prime[ # ] - # ] & ]] (* Zak Seidov, Jan 04 2013 *)
Select[Range[4000], AllTrue[Prime[#]+{#, -#}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 25 2019 *)
PROG
(PARI) { n=0; default(primelimit, 1800000); for (m=1, 10^9, if (isprime(prime(m) + m) && isprime(prime(m) - m), write("b064403.txt", n++, " ", m); if (n==1000, break)) ) } \\ Harry J. Smith, Sep 13 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Sep 28 2001
STATUS
approved