login
A376030
Primes which can be turned into a different prime by exchanging two digits. (Leading zeros are not allowed.)
1
13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 131, 137, 139, 149, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 239, 241, 251, 277, 281, 283, 293, 311, 313, 317, 331, 337, 347, 349, 359, 373, 379, 389, 397, 419, 421, 439, 457, 461, 463, 467, 491, 521, 547, 563
OFFSET
1,1
LINKS
EXAMPLE
13 is the first term, since 31 is also prime. 113 is a term, since 131 is prime. 101 is not allowed as a term: 011 is prime, but has a leading zero.
PROG
(Python)
from sympy import isprime
from itertools import combinations
def ok(n):
if not isprime(n): return False
s = list(str(n))
for i, j in combinations(range(len(s)), 2):
sij = s[:]
sij[i], sij[j] = sij[j], sij[i]
if sij[0] != "0" and sij != s and isprime(int("".join(sij))):
return True
return False
print([k for k in range(565) if ok(k)]) # Michael S. Branicky, Sep 07 2024
CROSSREFS
Subsequence of A225035.
Cf. A375965.
Sequence in context: A225035 A375965 A344626 * A006567 A263240 A246043
KEYWORD
base,nonn
AUTHOR
James S. DeArmon, Sep 06 2024
EXTENSIONS
Corrected and more terms from Michael S. Branicky, Sep 07 2024
STATUS
approved