Truncatable Prime

DOWNLOAD Mathematica Notebook

A zerofree number n is called right truncatable if n and all numbers obtained by successively removing the rightmost digits are prime. There are exactly 83 right truncatable primes in base 10. The first few are 2, 3, 5, 7, 23, 29, 31, 37, 53, 59, 71, 73, 79, 233, 239, 293, 311, 313, 317, 373, 379, 593, 599, ... (OEIS A024770), the largest being the 8-digit number 73939133 (Angell and Godwin 1977). The numbers of n-digit right prime strings for n=1, 2, ..., 8 are 4, 9, 14, 16, 15, 12, 8, and 5 (OEIS A050986; Rivera puzzle 70).

Similarly, call a number n left truncatable if n and all numbers obtained by successively removing the leftmost digit are prime. There are exactly 4260 left truncatable primes in base 10 when the digit zero is not allowed. The first few are 2, 3, 5, 7, 13, 17, 23, 37, 43, 47, 53, 67, 73, 83, 97, 113, 137, 167, 173, ... (OEIS A024785), with the largest being the 24-digit number 357686312646216567629137 (Angell and Godwin 1977). The numbers of n-digit left truncatable primes for n=1, 2, ... 24 are 4, 11, 39, 99, 192, 326, 429, 521, 545, 517, 448, 354, 276, 212, 117, 72, 42, 24, 13, 6, 5, 4, 3, and 1 (OEIS A050987; Rivera puzzle 70).

If zeros are permitted, the sequence of left truncatable primes is infinite, and the first few terms are 2, 3, 5, 7, 13, 17, 23, 37, 43, 47, 53, 67, 73, 83, 97, 103, 107, 113, 137, 167, 173, 197, 223, 283, 307, ... (OEIS A033664).

J. Shallit has shown that in base 10, there is a finite, minimal list of primes that do not have any other primes as substrings (where digits do not need to be consecutive). This result is a special case of a much more general theorem, whose proof is unfortunately nonconstructive.

Call an n-digit prime p_n (with n>=2) is a restricted left truncatable prime if

1. If the leftmost digit of p_i is deleted, a prime number p_(i-1) is obtained for 2<=i<=n, and

2. No prime with n+1 digits can have its leftmost digit removed to produce p_n.

Kahan and Weintraub (1998) dub such primes "Henry VIII primes." Restricted left truncatable primes p_n are therefore a subset of left truncatable primes for which there are no left truncatable primes of length n+1 having the same n last digits as p_n. There are a total of 1440 such primes, and the first few are 773, 3373, 3947, 4643, 5113, 6397, 6967, 7937, ... (OEIS A055521), the largest being 357686312646216567629137 (Angell and Godwin 1977, Kahan and Weintraub 1998).

Truncatable primes are also called Russian doll primes.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.