A050987 Number of n-digit left-truncatable primes.
4, 11, 39, 99, 192, 326, 429, 521, 545, 517, 448, 354, 276, 212, 117, 72, 42, 24, 13, 6, 5, 4, 3, 1, 0
Offset: 1
Links
- I. O. Angell and H. J. Godwin, On Truncatable Primes, Math. Comput. 31, 265-267, 1977.
- P. De Geest, The list of 4260 left-truncatable primes
- Eric Weisstein's World of Mathematics, Truncatable Prime.
- Index entries for sequences related to numbers of primes in various ranges
- Index entries for sequences related to truncatable primes
Programs
-
PARI
A050987=vector(25, n, #p=concat(apply(p->select(isprime, vector(9, i, i*10^(n-1)+p)), if(n>1, p)))) \\ M. F. Hasler, Nov 07 2018
-
Python
from sympy import isprime def alst(): primes, alst = [2, 3, 5, 7], [4] while len(primes) > 0: candidates = set(int(d+str(p)) for p in primes for d in "123456789") primes = [c for c in candidates if isprime(c)] alst.append(len(primes)) return alst print(alst()) # Michael S. Branicky, Apr 11 2021
Extensions
Edited by Ray Chandler, Mar 13 2007
a(25) = 0 added by M. F. Hasler, Nov 07 2018
Comments