A386528 Primes which remain primes after the mapping {1 -> 3, 3 -> 5, 5 -> 7, 7 -> 9, 9 -> 1} of its decimal digits.
2, 3, 5, 19, 31, 37, 41, 59, 97, 131, 137, 151, 157, 181, 191, 199, 211, 227, 239, 271, 281, 307, 349, 359, 367, 409, 419, 457, 461, 479, 509, 541, 569, 619, 631, 641, 691, 727, 797, 821, 827, 829, 881, 907, 919, 947, 971, 977, 991, 1009, 1021, 1049, 1069, 1087, 1097, 1109, 1151
Offset: 1
Examples
19 is a term since the mapping produces 31, which is prime; 31 is a term since the mapping produces 53, which is prime.
Programs
-
Mathematica
fQ[n_] := PrimeQ[ FromDigits[ IntegerDigits[ n] /. {1 -> 3, 3 -> 5, 5 -> 7, 7 -> 9, 9 -> 1}]]; Select[ Prime@ Range@ 200, fQ]
-
Python
from sympy import isprime def ok(n): return isprime(n) and isprime(int(str(n).translate(str.maketrans("13579","35791")))) print([k for k in range(1200) if ok(k)]) # Michael S. Branicky, Aug 24 2025
Comments