OFFSET
1,1
COMMENTS
Imagine that each digit of a prime is on a wheel on a combination lock and each wheel is being rotated two notches. Thus for the digits 0 to 7, the replacement digit is simply the digit+2, but for 8 the replacement digit is 0 and for 9 the replacement digit is 1. Thus 227 --> 449 --> 661 --> 883 --> 5 (initial 0's are dropped on results).
EXAMPLE
59 is a term because 5+2=7 and 9+2=1 (ignoring carry) and 71 is prime.
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def inc2(n): return int("".join(str((int(d)+2)%10) for d in str(n)))
def agen(): # generator of terms
p = 2
while True:
if isprime(inc2(p)):
yield p
p = nextprime(p)
print(list(islice(agen(), 55))) # Michael S. Branicky, Jan 05 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Chuck Seggelin (barkeep(AT)plastereddragon.com), Oct 16 2003
STATUS
approved