A236119 Primes p with prime(p) - p - 1 and prime(p) - p + 1 both prime.
5, 17, 23, 41, 71, 83, 173, 293, 337, 353, 563, 571, 719, 811, 911, 953, 1201, 1483, 1579, 1877, 2081, 2089, 2309, 2579, 2749, 2803, 3329, 3343, 3511, 3691, 3779, 3851, 3881, 3907, 4021, 4049, 4093, 4657, 4813, 5051, 5179, 5333, 5519, 5591, 6053, 6547, 6841, 7151, 7723, 8209
Offset: 1
Keywords
Examples
a(1) = 5 since neither prime(2) - 2 - 1 = 0 nor prime(3) - 3 - 1 = 1 is prime, but prime(5) - 5 - 1 = 5 and prime(5) - 5 + 1 = 7 are both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
Programs
-
Mathematica
p[n_]:=PrimeQ[Prime[n]-n-1]&&PrimeQ[Prime[n]-n+1] n=0;Do[If[p[Prime[k]],n=n+1;Print[n," ",Prime[k]]],{k,1,1100}]
-
PARI
s=[]; forprime(p=2, 10000, if(isprime(prime(p)-p-1) && isprime(prime(p)-p+1), s=concat(s, p))); s \\ Colin Barker, Jan 19 2014
Comments