OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
EXAMPLE
113 is in the sequence because PrimePi(113) is 30, Prime(113) is 617, and both 587 and 647 are primes.
MATHEMATICA
Do[p0 = Prime[ Prime[n]]; p1 = PrimePi[ Prime[n]]; If[ PrimeQ[p0 + p1] && PrimeQ[p0 - p1], Print[ Prime[n]]], {n, 1, 5000} ]
spQ[n_]:=Module[{p=PrimePi[n]}, AllTrue[Prime[n]+{p, -p}, PrimeQ]]; Select[ Prime[ Range[10000]], spQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 03 2018 *)
PROG
(PARI) { n=0; default(primelimit, 4294965247); for (m=1, 10^9, p=prime(m); p0 = prime(p); p1 = primepi(p); if (isprime(p0 + p1) && isprime(p0 - p1), write("b065117.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 10 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Nov 12 2001
EXTENSIONS
Example corrected by Harvey P. Dale, Sep 03 2018
STATUS
approved