A350460 Positive integers k such that if p is the next prime > k then p - k is prime.
3, 5, 8, 9, 11, 14, 15, 17, 20, 21, 24, 26, 27, 29, 32, 34, 35, 38, 39, 41, 44, 45, 48, 50, 51, 54, 56, 57, 59, 62, 64, 65, 68, 69, 71, 74, 76, 77, 80, 81, 84, 86, 87, 90, 92, 94, 95, 98, 99, 101, 104, 105, 107, 110, 111, 114, 116, 120, 122, 124, 125, 128, 129
Offset: 1
Keywords
Examples
3 is a term because the next prime > 3 is 5, and 5 - 3 = 2, which is prime. 14 is a term because the next prime > 14 is 17, and 17 - 14 = 3, which is prime.
Programs
-
Mathematica
Select[Range[130], PrimeQ[NextPrime[#] - #] &] (* Amiram Eldar, Jan 01 2022 *)
-
PARI
isok(k) = my(p=nextprime(k+1)); isprime(p-k); \\ Michel Marcus, Jan 01 2022
-
Python
from sympy import isprime, nextprime def ok(n): return n > 0 and isprime(nextprime(n) - n) print([k for k in range(130) if ok(k)]) # Michael S. Branicky, Jan 01 2022
Comments