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!)
A359137 Primes such that there is a nontrivial permutation which when applied to the digits produces a prime (Version 2). 6
11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 107, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 271, 277, 281, 283, 293, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 419, 421 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
A prime p with decimal expansion p = d_1 d_2 ... d_m is in this sequence iff there is a non-identity permutation pi in S_m such that q = d_pi(1) d_pi(2) ... d_pi(m) is also a prime. The prime q may or may not be equal to p. Leading zeros are not permitted in q.
One must be careful when using the phrase "nontrivial permutation of the digits". When the first and third digits of 101 are exchanged, this is applying the nontrivial permutation (1,3) in S_3 to the digits, leaving the number itself unchanged. One should specify whether it is the permutation that is nontrivial, or its action on what is being permuted. In this sequence and A359136, we mean that the permutation itself is nontrivial.
There are only 53 primes not in this sequence, the greatest of which is 8059. - Andrew Howroyd, Jan 22 2023
LINKS
PROG
(PARI) isok(n)={my(v=vecsort(digits(n))); if(#Set(v)<#v, 1, forperm(v, u, if(u[1]<>0, my(t=fromdigits(Vec(u))); if(isprime(t) && t<>n, return(1)))); 0)} \\ Andrew Howroyd, Jan 22 2023
(Python)
from sympy import isprime
from itertools import permutations as P
def ok(n):
if not isprime(n): return False
if len(s:=str(n)) > len(set(s)): return True
return any(isprime(t) for t in (int("".join(p)) for p in P(s) if p[0]!="0") if t!=n)
print([k for k in range(422) if ok(k)]) # Michael S. Branicky, Jan 23 2023
CROSSREFS
Sequence in context: A105892 A111337 A359136 * A266675 A185104 A240570
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More than the usual number of terms are shown in order to distinguish this from other similar sequences.
Incorrect terms removed by Andrew Howroyd, Jan 22 2023
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 June 29 11:26 EDT 2024. Contains 373848 sequences. (Running on oeis4.)