login
A371509
a(n) is the smallest prime that becomes composite if any single digit of its base-(2n+1) expansion is changed to a different digit (but not to zero).
1
2, 67, 223, 2789, 701, 2423, 243367, 10513, 10909, 2114429, 68543, 181141, 6139219, 114493, 356479, 399946711, 22549349, 8371249, 660040873, 12088631, 3352003
OFFSET
1,1
COMMENTS
Bisection of A323745. a(n) <= A371475(n) with equality for some values of n.
FORMULA
a(n) = A323745(2n+1).
a(n) <= A371475(n).
PROG
(Python)
from sympy import isprime, nextprime
from sympy.ntheory import digits
def A371509(n):
if n == 1: return 2
p, r = 5, (n<<1)+1
while True:
m = 1
for j in digits(p, r)[:0:-1]:
for k in range(2-(j&1), r, 2):
if k!=j and isprime(p+(k-j)*m):
break
else:
m *= r
continue
break
else:
return p
p = nextprime(p)
CROSSREFS
KEYWORD
nonn,more,base
AUTHOR
Chai Wah Wu, Mar 25 2024
STATUS
approved