login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A347864
Left- or right-truncatable primes, restricted to one consecutive zero.
1
2, 3, 5, 7, 13, 17, 23, 29, 31, 37, 43, 47, 53, 59, 67, 71, 73, 79, 83, 97, 103, 107, 113, 131, 137, 139, 167, 173, 179, 197, 223, 229, 233, 239, 271, 283, 293, 307, 311, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 397, 431, 433, 439, 443, 467, 479, 503
OFFSET
1,1
COMMENTS
There are 16484138 primes in this list, in total. The largest one has 60 digits and there is only one of that length.
PROG
(Python)
from sympy import isprime
route = set({})
nums = [i*(10**j) for i in range(1, 10) for j in range(2)]
def addnum(a):
global route
for j in nums:
b = int("{}{}".format(a, j))
if isprime(b):
if b not in route:
route.add(b)
addnum(b)
for j in nums:
b = int("{}{}".format(j, a))
if isprime(b):
if b not in route:
route.add(b)
addnum(b)
def run():
for i in nums:
if isprime(i):
addnum(i)
CROSSREFS
Left- or right-truncatable primes, excluding all 0s: A137812.
The number of primes of length n following these rules: A346662.
Sequence in context: A179336 A080608 A305352 * A137812 A216578 A094317
KEYWORD
nonn,fini
AUTHOR
Timothy Smith, Jan 25 2022
STATUS
approved