login
A395332
Smallest n-digit base-3 deletable prime.
2
2, 5, 11, 29, 83, 251, 809, 2267, 6803, 20231, 59699, 177797, 533063, 1599203, 4798091, 14394131, 43104077, 129509579, 387893609, 1163369621, 3488010587, 10461810473, 31385429963, 94154205701, 282459695381, 847320895613, 2541962686727, 7625868891857, 22877166983813
OFFSET
1,1
COMMENTS
A base-3 deletable prime is a prime whose base-3 representation can be reduced to the single-digit prime 2 by deleting one digit at a time, without ever creating a leading zero, so that every intermediate value is prime. a(n) is the smallest such prime with exactly n digits in base 3. This is the base-3 analog of A125589 (base 10).
EXAMPLE
a(2) = 5: in base 3, 5 is written 12; deleting the digit 1 leaves 2, which is prime.
a(5) = 83: in base 3, 83 is written 10002; the deletions 10002 -> 1002 -> 102 -> 12 -> 2 (base 3) correspond to the primes 83, 29, 11, 5, 2.
PROG
(Python)
from sympy import isprime
def to3(n):
s=""
while n: s=str(n%3)+s; n//=3
return s
def deletable(p):
s=to3(p)
if len(s)==1: return isprime(p)
for i in range(len(s)):
t=s[:i]+s[i+1:]
if t[0]=="0": continue
v=int(t, 3)
if isprime(v) and deletable(v): return True
return False
def a(n):
for p in range(3**(n-1), 3**n):
if isprime(p) and deletable(p): return p
print([a(n) for n in range(1, 12)])
CROSSREFS
KEYWORD
nonn,base,new
AUTHOR
Daniel Okwor, Jun 15 2026
STATUS
approved