OFFSET
1,1
COMMENTS
Digital complement of a digit d is 10-d if d > 0, 0 otherwise.
Primes in A345343.
EXAMPLE
71147 is a term since 31147, 79147, 71947, 71167 and 71143 are all primes.
MATHEMATICA
q[n_] := PrimeQ[n] && Module[{d = IntegerDigits[n]}, And @@ PrimeQ[Table[ FromDigits[ReplacePart[d, i -> If[d[[i]] == 0, d[[i]], 10 - d[[i]]]]], {i, 1, Length[d]}]]]; Select[Range[10^5], q] (* Amiram Eldar, Jul 06 2021 *)
PROG
(Python)
from sympy import isprime, primerange
def comp(d, i): return d[:i] + str((10-int(d[i]))%10) + d[i+1:]
def ok(p):
d = str(p)
return all(isprime(int(comp(d, i))) for i in range(len(d)))
print(list(filter(ok, primerange(1, 95000)))) # Michael S. Branicky, Jun 20 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Lamine Ngom, Jun 20 2021
STATUS
approved