login
A258185
Primes p such that p^2 - q + 1 is prime, where p, q are consecutive primes and p<q.
1
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,1
LINKS
EXAMPLE
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.
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 *)
PROG
(PARI) c=0; forprime(p = 1, 1e6, if(isprime(p^2 - nextprime(p+1) + 1), c++; print(c, " ", p)))
(Magma) [n: n in [0..10^4] | IsPrime(n) and IsPrime(n^2 - NextPrime(n) +1)]; // Vincenzo Librandi, May 23 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
K. D. Bajpai, May 23 2015
EXTENSIONS
Definition clarified by Harvey P. Dale, Sep 06 2016
STATUS
approved