login
A375965
Primes which can be turned into a different prime by exchanging two consecutive digits.
3
13, 17, 31, 37, 71, 73, 79, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 163, 167, 173, 179, 181, 191, 193, 197, 199, 239, 241, 251, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 349, 373, 379, 389, 397, 401, 419, 421, 439, 457, 461, 463, 467, 491, 503
OFFSET
1,1
COMMENTS
Heuristically, both this sequence and its complement should have positive density within the primes. Empirically, n/pi(a(n)) approaches ~0.75 for large n. But is this sequence even infinite?
Dickson's conjecture implies it is infinite, e.g. it implies that there are infinitely many primes ending in 13 for which changing the last two digits to 31 produces a prime. - Robert Israel, Sep 04 2024
LINKS
EXAMPLE
2, 3, 5, and 7 are excluded, since they have no two digits to exchange.
11 is excluded, since it yields only itself.
13 and 17 are included, since they yield the primes 31 and 71.
19, 23, and 29 are excluded, since they yield the composite numbers 91, 32, and 92.
MAPLE
filter:= proc(n) local L, d, i;
if not isprime(n) then return false fi;
L:= convert(n, base, 10); d:= nops(L);
for i from 1 to d-1 do
if L[i] <> L[i+1] and isprime(n + (L[i]-L[i+1])*(10^i-10^(i-1))) then return true fi
od;
false
end proc:
select(filter, [seq(i, i=11 .. 1---, 2)]); # Robert Israel, Sep 04 2024
MATHEMATICA
Select[Prime[Range[100]], With[{digits = IntegerDigits[#]}, AnyTrue[Complement[FromDigits[Permute[digits, Cycles[{{#, # + 1}}]]] & /@ Range[Length[digits] - 1], {#}], PrimeQ]] &]
PROG
(Python)
from sympy import isprime
def ok(n):
if not isprime(n): return False
s = str(n)
for i in range(len(s)-1):
t = int(s[:i]+s[i+1]+s[i]+s[i+2:])
if t != n and isprime(t): return True
return False
print([k for k in range(504) if ok(k)]) # Michael S. Branicky, Sep 04 2024
CROSSREFS
Subsequence of A225035.
Sequence in context: A180526 A161401 A225035 * A344626 A376030 A006567
KEYWORD
nonn,base,easy
AUTHOR
Matthew House, Sep 04 2024
STATUS
approved