OFFSET
1,1
COMMENTS
Bisection of A186995. Smallest weak prime in odd bases appear to be relatively smaller than smallest weak prime in even bases. This could be due to the fact that for an odd base and an odd prime, any digit change with an odd difference from the original digit results in an even number and thus not prime, so only digit changes with an even difference need to be checked for primality, whereas for an even base, all digit changes need to be checked.
Smallest weak prime in odd bases of the form 6k+3 appear to be relatively larger than smallest weak prime in other odd bases.
LINKS
Terence Tao, A remark on primality testing and decimal expansions, arXiv:0802.3361 [math.NT], 2008.
Terence Tao, A remark on primality testing and decimal expansions, Journal of the Australian Mathematical Society 91:3 (2011), pp. 405-413.
Eric Weisstein's World of Mathematics, Weakly Prime
FORMULA
a(n) = A186995(2*n+1).
PROG
(Python)
from sympy import isprime, nextprime
from sympy.ntheory import digits
def A371475(n):
if n == 1: return 2
p, r = 5, (n<<1)+1
while True:
s = digits(p, r)[1:]
l = len(s)
for i, j in enumerate(s[::-1]):
m = r**i
for k in range(j&1, r, 2):
if k!=j and isprime(p+(k-j)*m):
break
else:
continue
break
else:
return p
p = nextprime(p)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Mar 24 2024
EXTENSIONS
a(22)-a(27) from Michael S. Branicky, Apr 01 2024
a(28)-a(30) from Michael S. Branicky, Apr 06 2024
STATUS
approved