OFFSET
2,1
COMMENTS
See b-file for other known terms (too large for the data section).
The a(11) final value is noteworthy in that the base 11 sequence only contains 659 terms before reaching this value, the length of which contains 111 base 11 digits. From this value 1342 possible candidate numbers can be created for the next term, but remarkably only one of these is prime - the previously used term.
See A389926 for the length of each sequence in base n.
It is conjectured that the sequence of primes in base n terminates for all n.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 2..13
EXAMPLE
a(2) = 103. See A389925.
a(10) = 1200000000413309. See A389825.
a(3) = 3 as in base 3 the entire sequence is: 2 = 2_3, 5 = 12_3, 11 = 102_3, 3 = 10_3, and 3 = 10_3 is the final term as no primes can be created from removing a digit from 10_3, while the only prime that can be created from adding a 0, 1 or 2 digit is 11 = 102_3, but that has already been used.
PROG
(Python)
from gmpy2 import digits, is_prime, mpz
def a(n):
base, prevan = n, None
an, aset, digset = 2, {2}, "".join(digits(i, base) for i in range(base))
while an != -1:
aset.add(an)
prevan = an
s = digits(an, base)
D = set(p for i in range(len(s)) if len(t:=s[:i]+s[i+1:]) and is_prime(p:=mpz(t, base)))
if D and (Dcands:=D-aset):
an = min(D - aset)
continue
A = set(p for i in range(len(s)+1) for d in digset if is_prime(p:=mpz(s[:i]+d+s[i:], base)))
an = min(Acands) if A and (Acands:=A-aset) else -1
return int(prevan)
print([a(n) for n in range(2, 10)]) # Michael S. Branicky, Oct 21 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Scott R. Shannon, Oct 19 2025
STATUS
approved
