login
A088785
Primes yielding other primes after each digit is incremented by 2 with carries ignored.
3
3, 5, 19, 29, 31, 37, 59, 61, 67, 83, 97, 127, 131, 137, 151, 157, 167, 191, 199, 211, 227, 241, 257, 277, 347, 359, 419, 421, 431, 449, 461, 479, 491, 521, 547, 587, 601, 607, 617, 631, 641, 661, 761, 797, 821, 829, 857, 859, 881, 883, 919, 941, 971, 977, 991
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