OFFSET
1,1
COMMENTS
Rigidly-deletable primes are deletable primes where the choice of digit to delete is unique (all other choices give nonprime numbers).
Leading zeros are allowed in the number that appears after the digit is deleted.
LINKS
Carlos Rivera, Puzzle 138. Deletable primes, The Prime Puzzles and Problems Connection.
EXAMPLE
The prime 103 is not a member since removing a digit will either give 03 which has a leading zero (3 is a prime number), or give one of the numbers 13 which is prime, or 10 which is composite.
The prime 509 is a member since removing a digit will either give 09 which has a leading zero (9 is a composite number), or give one of the numbers 59 which is prime, or 50 which is composite. Then removing a digit from 59 will either give 9, or 5 which is prime.
PROG
(PARI) for(k=2, 3259, if(isprime(k), a=k; r=#digits(a); q=r; for(y=1, r, L=List([]); for(d=1, q, T=List(Vec(Str(a))); listpop(T, d); listput(L, concat(T))); t=0; for(b=1, q, w=L[b]; if(isprime(eval(w)), t++; u=w); if(t==2, break)); if(t==1, q=#Vec(u); a=u, break); if(y==r, print1(k, ", ")))));
(Python)
from sympy import isprime
def ok(n):
if not isprime(n): return False
if n < 10: return True
s, c, d = str(n), 0, None
for i in range(len(s)):
di = int(s[:i]+s[i+1:])
if isprime(di):
c += 1
if c > 1:
return False
d = di
return ok(d) and len(str(d)) == len(s) - 1
print([k for k in range(3260) if ok(k)]) # Michael S. Branicky, Dec 31 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Arkadiusz Wesolowski, Dec 31 2021
STATUS
approved