This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A346662 #25 Feb 18 2022 20:58:03 %S A346662 4,16,76,300,955,2648,6402,14339,28684,53450,91284,147064,221301, %T A346662 319067,433227,567565,700765,834464,947055,1050886,1114368,1157526, %U A346662 1150645,1117265,1044757,963722,855804,753172,633786,528122,426328,339866,264078,202013,150330,111055,78996,56123,38874,26644,17944,11898,7878,4945,3255,2024,1323,764,464,286,158,77,40,26,14,5,5,4,1,1 %N A346662 Number of n-digit left- or right-truncatable primes with no consecutive zero digits. %C A346662 A left- or right-truncatable prime is a prime number from which one digit at a time may be removed from the left or right end until a single-digit prime is reached, with each digit removal resulting in a prime. There exists only one such 60-digit prime: 202075909708030901050930450609080660821035604908735717137397. Since it cannot be extended, there are no such primes with more than 60 digits, so a(60)=1 is the final term of the sequence. %H A346662 Wikipedia, <a href="https://en.wikipedia.org/wiki/Truncatable_prime">Truncatable prime</a> %e A346662 The 16 two-digit left- or right-truncatable primes with no consecutive zero digits are 13, 17, 23, 29, 31, 37, 43, 47, 53, 59, 67, 71, 73, 79, 83, 97. %e A346662 The first 10 three-digit left- or right-truncatable primes with no consecutive zero digits are 103, 107, 113, 131, 137, 139, 167, 173, 179, 197. %e A346662 The unique 60-digit left- or right-truncatable prime with no consecutive zero digits can be sequentially truncated to a single-digit prime as follows, where each "..." indicates repeated removal of the leftmost digit: %e A346662 202075909708030901050930450609080660821035604908735717137397 %e A346662 ... %e A346662 2075909708030901050930450609080660821035604908735717137397 %e A346662 207590970803090105093045060908066082103560490873571713739 %e A346662 ... %e A346662 970803090105093045060908066082103560490873571713739 %e A346662 97080309010509304506090806608210356049087357171373 %e A346662 ... %e A346662 6090806608210356049087357171373 %e A346662 609080660821035604908735717137 %e A346662 ... %e A346662 80660821035604908735717137 %e A346662 8066082103560490873571713 %e A346662 806608210356049087357171 %e A346662 ... %e A346662 8210356049087357171 %e A346662 821035604908735717 %e A346662 21035604908735717 %e A346662 2103560490873571 %e A346662 ... %e A346662 71 %e A346662 7 %o A346662 (Python) %o A346662 from sympy import isprime %o A346662 dumps = set({}) %o A346662 route = set({}) %o A346662 nums = [i*(10**j) for i in range(1, 10) for j in range(2)] %o A346662 def addnum(a): %o A346662 global route %o A346662 for j in nums: %o A346662 b = int("{}{}".format(a, j)) %o A346662 if isprime(b): %o A346662 if b not in route: %o A346662 route.add(b) %o A346662 addnum(b) %o A346662 for j in nums: %o A346662 b = int("{}{}".format(j, a)) %o A346662 if isprime(b): %o A346662 if b not in route: %o A346662 route.add(b) %o A346662 addnum(b) %o A346662 def run(): %o A346662 for i in nums: %o A346662 if isprime(i): %o A346662 addnum(i) %o A346662 run() %Y A346662 Left- or right-truncatable primes, excluding all 0s: A137812. %Y A346662 Left- or right-truncatable primes with 0s allowed, but none consecutive: A347864. %K A346662 nonn,fini,full %O A346662 1,1 %A A346662 _Timothy Smith_, Jan 25 2022