A258185
Primes p such that p^2 - q + 1 is prime, where p, q are consecutive primes and p
2, 3, 5, 11, 17, 29, 71, 101, 149, 197, 269, 419, 523, 599, 617, 641, 683, 761, 857, 997, 1061, 1063, 1091, 1151, 1201, 1277, 1289, 1409, 1531, 1571, 1607, 1753, 1789, 1987, 2027, 2039, 2111, 2129, 2161, 2267, 2309, 2339, 2503, 2687, 2753, 2999, 3049, 3067, 3257
Offset: 1
Examples
a(4) = 11 is prime: 13 is next prime. 11^2 - 13 + 1 = 109 which is also prime. a(5) = 17 is prime: 19 is next prime. 17^2 - 19 + 1 = 271 which is also prime.
Links
- K. D. Bajpai, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[n: n in [0..10^4] | IsPrime(n) and IsPrime(n^2 - NextPrime(n) +1)]; // Vincenzo Librandi, May 23 2015
-
Mathematica
Select[Prime[Range[1000]], PrimeQ[#^2 - NextPrime[#] + 1] &] Select[Partition[Prime[Range[500]],2,1],PrimeQ[#[[1]]^2-#[[2]]+1]&][[All,1]] (* Harvey P. Dale, Sep 06 2016 *)
-
PARI
c=0; forprime(p = 1,1e6, if(isprime(p^2 - nextprime(p+1) + 1), c++; print(c," ",p)))
Extensions
Definition clarified by Harvey P. Dale, Sep 06 2016