OFFSET
1,1
COMMENTS
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Zhi-Wei Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014.
EXAMPLE
a(1) = 2 since prime(2) - 2 + 1 = 3 - 1 = 2 and prime(3) - 3 + 1 = 5 - 2 = 3 are both prime.
a(2) = 3 since prime(3) - 3 + 1 = 5 - 2 = 3 and prime(5) - 5 + 1 = 11 - 4 = 7 are both prime.
MATHEMATICA
p[k_]:=PrimeQ[Prime[Prime[k]]-Prime[k]+1]
n=0
Do[If[p[k]&&p[k+1], n=n+1; Print[n, " ", Prime[k]]], {k, 1, 914}]
Select[Prime[Range[1000]], AllTrue[{Prime[#]-#+1, Prime[NextPrime[#]]-NextPrime[ #]+1}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 24 2019 *)
PROG
(PARI) step(p, k)=k++; while(k--, p=nextprime(p+1)); p
p=0; forprime(r=2, 1e6, if(isprime(p++) && isprime(r-p+1), q=nextprime(p+1); if(isprime(step(r, q-p)-q+1), print1(p", ")))) \\ Charles R Greathouse IV, Mar 06 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 05 2014
STATUS
approved