OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Index to Primes, Primes that become a different prime under some mapping.
FORMULA
MATHEMATICA
fQ[n_] := Block[{id = IntegerDigits@n}, (MemberQ[id, s[[1]]] || MemberQ[id, s[[2]]]) && PrimeQ[ FromDigits[id /. {s[[1]] -> s[[2]], s[[2]] -> s[[1]] }] ]]; t = Union@ Flatten@ Table[s = {j, k}; Select[ Prime@ Range@ 25000, fQ], {j, 0, 8}, {k, j + 1, 9}] ]]; Complement[ Prime@ Range@ 25000, t]
PROG
(Python)
from sympy import isprime
def m(s):
return [s.translate({ord(c):ord(d), ord(d):ord(c)}) for c in set(s) for d in "0123456789" if d != c]
def ok(n):
return isprime(n) and not any(isprime(int(t)) for t in m(str(n)))
print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Oct 31 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov and Robert G. Wilson v, Sep 09 2010
EXTENSIONS
a(33) and beyond from Michael S. Branicky, Oct 31 2023
STATUS
approved