login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345529 Primes that yield a prime when any single digit is replaced by its 10's complement. 0
3, 5, 7, 17, 47, 71, 107, 223, 401, 823, 827, 857, 883, 2087, 2089, 2539, 3253, 4007, 5051, 5059, 5503, 5507, 7541, 8447, 10247, 12401, 18041, 25303, 33529, 33589, 35533, 40427, 44171, 45557, 53503, 53653, 53899, 54401, 55001, 55009, 55333, 55817, 57077, 71147, 81017, 82003, 93553 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Digital complement of a digit d is 10-d if d > 0, 0 otherwise.
Primes in A345343.
LINKS
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
Sequence in context: A191064 A075227 A350880 * A215684 A229132 A270779
KEYWORD
nonn,base,easy
AUTHOR
Lamine Ngom, Jun 20 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 07:27 EDT 2024. Contains 371265 sequences. (Running on oeis4.)