A truncatable prime remains prime while digits are removed one at a time from a specified end. For example, 3797 stays prime when shortened from the left and when shortened from the right, making it a two-sided truncatable prime in base 10.
Definition
A truncatable prime is a prime number whose successive leftmost or rightmost digit removals also produce prime numbers. The direction of removal is part of the definition, and the property depends on the numeral base being used.
What Makes a Prime Truncatable?
Being prime is only the first requirement. Every number produced along the truncation chain must also have exactly two positive divisors: 1 and itself.
Consider 2333. Removing digits from the right produces:
Right-Truncation Chain
2333 → 233 → 23 → 2
All four numbers are prime, so 2333 is right-truncatable. The same number is not left-truncatable because removing its first digit produces 333, which is divisible by 3.
Left-Truncatable
The leftmost digit is removed repeatedly, and every resulting suffix is prime.
Right-Truncatable
The rightmost digit is removed repeatedly, and every resulting prefix is prime.
Two-Sided
The number satisfies both the left-truncatable and right-truncatable conditions.
How Left and Right Truncation Differ
A number may qualify in one direction but fail in the other. Each direction generates a different sequence of integers and therefore requires a separate primality check.
| Number | Direction | Truncation Chain | Classification |
|---|---|---|---|
| 9137 | Left | 9137 → 137 → 37 → 7 | Left-truncatable |
| 2333 | Right | 2333 → 233 → 23 → 2 | Right-truncatable |
| 3797 | Left | 3797 → 797 → 97 → 7 | Passes |
| 3797 | Right | 3797 → 379 → 37 → 3 | Passes |
| 293 | Left | 293 → 93 → 3 | Fails at 93 |
Why 313 Qualifies
The prime 313 is two-sided truncatable because its left chain is 313 → 13 → 3 and its right chain is 313 → 31 → 3. Its middle digit is 1, but deleting digits from both ends simultaneously is not required.
How Many Decimal Truncatable Primes Exist?
The usual decimal lists treat 2, 3, 5, and 7 as the one-digit starting primes. They are often omitted when a problem asks for nontrivial truncatable primes because no digit can actually be removed from them.
| Type | Including One-Digit Primes | Nontrivial Count | Largest Member |
|---|---|---|---|
| Right-truncatable | 83 | 79 | 73,939,133 |
| Left-truncatable without zero digits | 4,260 | 4,256 | 357,686,312,646,216,567,629,137 |
| Two-sided | 15 | 11 | 739,397 |
The qualification about zero digits matters for left truncation. Allowing a result such as 03 to be interpreted as 3 changes the definition and produces a different collection. The familiar count of 4,260 uses the zero-free convention.
Testing a Truncatable Prime Candidate
A candidate is checked by forming its complete truncation chain and testing every member for primality. Finding one composite number is enough to reject the candidate in that direction.
Square Root Test
For a chain member n, trial division only needs possible prime divisors up to √n. If n were composite, at least one factor in a factor pair would be no greater than its square root.
Each value in a chain can also be entered into the prime number checker to determine whether it is prime, composite, or outside those two categories.
Check a Prime in the Chain
Enter a whole number from a truncation sequence and test whether it is prime, composite, or neither.
Digit Restrictions in Base 10
Divisibility rules eliminate many candidates before a full primality test is needed. These restrictions do not prove that a number is truncatable, but they explain why the search branches narrow quickly.
Right Extensions
After the first digit, a right-truncatable prime can only use 1, 3, 7, or 9 as a newly appended final digit.
Left Final Digit
A multi-digit left-truncatable prime must end in 3 or 7 under the zero-free decimal definition.
Starting Digit
A right-truncatable chain must eventually shorten to one of the one-digit primes 2, 3, 5, or 7.
Why Right Extensions Use 1, 3, 7, or 9
Every multi-digit prime greater than 5 must end in 1, 3, 7, or 9. An appended even digit would make the new number divisible by 2, while an appended 5 would make it divisible by 5. Appending 0 would make it divisible by both 2 and 5.
This leaves four possible final digits, but most resulting numbers are still composite. For example, appending 9 to 23 produces 239, which is prime, while appending 1 produces 231, which is divisible by 3.
Candidate Does Not Mean Prime
Ending in 1, 3, 7, or 9 only avoids immediate divisibility by 2 and 5. A candidate may still have another factor. The number 91 ends in 1 but equals 7 × 13.
Truncatable Primes Form Search Trees
Right-truncatable primes can be generated from the roots 2, 3, 5, and 7. At each stage, one of the digits 1, 3, 7, or 9 is appended. A branch continues only when the new integer is prime.
Example Branch
2 → 23 → 233 → 2333 → 23333
The branch stops at 23,333 because 23,333 is composite.
The right-truncatable tree has no valid decimal branch beyond eight digits. Its largest member is 73,939,133.
A zero-free left-truncatable tree grows in the opposite direction. Digits from 1 through 9 are prepended to an existing prime suffix. The longest surviving branch reaches 24 digits and ends at 357,686,312,646,216,567,629,137.
All Nontrivial Two-Sided Truncatable Primes
Exactly eleven base-10 primes with at least two digits are both left-truncatable and right-truncatable under the standard zero-free convention:
- 23
- 37
- 53
- 73
- 313
- 317
- 373
- 797
- 3137
- 3797
- 739397
The Longest Two-Sided Example
The largest member, 739397, produces a prime at every stage in both permitted directions.
| Direction | Prime Sequence |
|---|---|
| From the left | 739397 → 39397 → 9397 → 397 → 97 → 7 |
| From the right | 739397 → 73939 → 7393 → 739 → 73 → 7 |
Truncatable Primes and Related Properties
Several digit-based prime properties sound similar but impose different conditions. The operation being performed on the digits determines which property is being tested.
| Property | Required Operation | Main Condition |
|---|---|---|
| Left-truncatable prime | Remove the leftmost digit repeatedly | Every suffix is prime |
| Right-truncatable prime | Remove the rightmost digit repeatedly | Every prefix is prime |
| Two-sided truncatable prime | Test both one-sided chains separately | Both chains contain only primes |
| Deletable prime | Remove a permitted digit at each stage | At least one valid deletion path remains prime |
| Palindromic prime | Read the digits in reverse order | The prime reads the same in both directions |
Common Definition Errors
Truncation removes an outer digit, not an arbitrary interior digit. Two-sided truncation tests two separate chains; it does not require simultaneous deletion from both ends. The numeral base and the treatment of leading zeros must also be stated when a nonstandard convention is used.
Why the Numeral Base Matters
Truncatability is a property of a number’s written digits as well as its primality. Changing the base changes the digit string, the available final digits, and the intermediate integers produced by truncation.
For instance, the decimal representation of a prime may generate only primes when shortened, while its binary or hexadecimal representation may produce a composite value at an intermediate stage. A number should therefore be described as truncatable in a stated base. Unless another base is named, truncatable prime lists normally use base 10.
Frequently Asked Questions
What is a truncatable prime?
It is a prime that continues to produce primes when digits are successively removed from a specified end. Left-truncatable, right-truncatable, and two-sided truncatable primes are separate classifications.
Is 3797 a truncatable prime?
Yes. Its left chain is 3797 → 797 → 97 → 7, while its right chain is 3797 → 379 → 37 → 3. Every number in both chains is prime.
How many two-sided truncatable primes are there?
There are 15 in base 10 when 2, 3, 5, and 7 are included. Excluding those one-digit cases leaves 11 nontrivial two-sided truncatable primes.
Are one-digit primes truncatable?
They satisfy the condition without any actual deletion because their truncation chains contain only the original number. Many exercises exclude them and ask only for truncatable primes with at least two digits.
Can a truncatable prime contain zero?
Standard zero-free left-truncatable lists exclude zero because truncation could create a leading-zero string. Right-truncatable primes cannot contain zero after their first digit because a chain member would then end in zero and be composite.
Does removing any digit have to produce a prime?
No. Standard truncatable primes only require successive removal of the leftmost digit, the rightmost digit, or both processes tested separately. Arbitrary digit deletion defines a different property.
Is every number ending in 1, 3, 7, or 9 a prime candidate?
Such an ending avoids divisibility by 2 and 5 for a multi-digit number, but it does not establish primality. Other divisors may still make the number composite.