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!)
A345343 Numbers that yield a prime when any single digit is replaced by its digital complement. 1
3, 5, 7, 8, 17, 33, 39, 47, 63, 71, 77, 93, 107, 171, 177, 221, 223, 287, 333, 339, 401, 441, 447, 699, 823, 827, 857, 883, 999, 1421, 1781, 2087, 2089, 2171, 2233, 2539, 3253, 3829, 3963, 4007, 4173, 4977, 5051, 5059, 5503, 5507, 6363, 7217, 7491, 7541, 8447, 10247 (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.
LINKS
EXAMPLE
3829 is a term since 7829, 3229, 3889 and 3821 are all primes.
MATHEMATICA
q[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^4], q] (* Amiram Eldar, Jun 15 2021 *)
PROG
(Python)
from sympy import isprime
def comp(d, i): return d[:i] + str((10-int(d[i]))%10) + d[i+1:]
def ok(n):
d = str(n)
return all(isprime(int(comp(d, i))) for i in range(len(d)))
print(list(filter(ok, range(1, 11000)))) # Michael S. Branicky, Jun 14 2021
(PARI) f(x) = if (x, 10-x);
isok(m) = {my(d=digits(m)); for (i=1, #d, d[i] = f(d[i]); if (!isprime(fromdigits(d)), return (0)); d[i] = f(d[i]); ); return (1); } \\ Michel Marcus, Jun 15 2021
CROSSREFS
Sequence in context: A229860 A081453 A352105 * A200655 A249439 A276693
KEYWORD
nonn,base,easy,less
AUTHOR
Lamine Ngom, Jun 14 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 April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)