The number 13 has an unusual two-way property: 13 is prime, and reversing its decimal digits gives 31, which is also prime. Because the reversed value is both prime and different from the original, 13 is an emirp number.
Emirp Number
A prime number p is an emirp when its base-10 digit reversal, written as R(p), is also prime and R(p) ≠ p.
13 → 31 Both are prime, so 13 and 31 form an emirp pair.
The name is literal: emirp is the word prime written backward. The condition that the reversed number must be different matters because it excludes palindromic primes such as 101.
The Three Conditions for an Emirp
Digit reversal alone does not make a number an emirp. The original integer and its reversal must pass separate primality tests, and the reversal must produce a different value.
| Number | Reversal | Original | Reversal | Result |
|---|---|---|---|---|
| 13 | 31 | Prime | Prime | Emirp |
| 23 | 32 | Prime | Composite | Not emirp |
| 101 | 101 | Prime | Prime | Palindromic prime |
| 91 | 19 | Composite | Prime | Not emirp |
The last example prevents a common mistake. Although reversing 91 produces the prime number 19, the starting number is composite because 91 = 7 × 13. Both sides of the reversal must be prime.
Emirps and Palindromic Primes Are Different
Emirp
13 → 31
Both numbers are prime and the reversal changes the value.
Palindromic Prime
101 → 101
The number is prime, but its digits read the same in both directions.
Prime but Not Emirp
19 → 91
The original is prime, but the reversed number is composite.
The phrase reversible prime is sometimes used for an emirp, although usage can be less precise because palindromic primes may also be included under that wording. Emirp specifically requires a different prime after reversal.
The First Emirp Pairs
Emirps naturally occur in two-way pairs. If reversing one prime produces another prime, reversing the second number restores the first.
| Prime | Reversed Prime | Difference |
|---|---|---|
| 13 | 31 | 18 |
| 17 | 71 | 54 |
| 37 | 73 | 36 |
| 79 | 97 | 18 |
| 107 | 701 | 594 |
| 113 | 311 | 198 |
| 149 | 941 | 792 |
| 157 | 751 | 594 |
| 167 | 761 | 594 |
| 179 | 971 | 792 |
| 199 | 991 | 792 |
The emirp sequence therefore begins:
- 13
- 17
- 31
- 37
- 71
- 73
- 79
- 97
- 107
- 113
- 149
- 157
- 167
- 179
- 199
There are exactly eight two-digit emirps: 13, 17, 31, 37, 71, 73, 79, and 97. They form four reversal pairs.
Why Emirps Always Come in Pairs
Digit reversal is reversible. If R(13) = 31, then applying the same operation again gives R(31) = 13.
Two-Way Reversal
R(R(p)) = p
For an emirp, both p and R(p) are prime and unequal. That automatically makes each number the emirp partner of the other.
This is why 149 and 941 should not be treated as unrelated examples. They represent the same reversal relationship viewed from opposite directions.
Digit Rules That Eliminate Many Candidates
A multi-digit emirp has stronger digit restrictions than an arbitrary integer. These restrictions can reject many candidates before a full primality test is needed.
The First and Last Digits Must Be 1, 3, 7, or 9
Every prime greater than 5 ends in 1, 3, 7, or 9. An emirp is prime, so its final digit must belong to that set.
The first digit has the same restriction for a different reason. After reversal, the original first digit becomes the final digit of the reversed number. Since that reversed number must also be prime, a multi-digit emirp cannot begin with 2, 4, 5, 6, or 8.
Possible endpoint digits for a multi-digit emirp:
- 1
- 3
- 7
- 9
For example, 23 is prime, but its first digit is 2. Reversal moves that 2 to the units place:
23 → 32
The result is even and greater than 2, so it is composite.
These digit rules are filters, not primality proofs. A number can begin and end with an allowed digit and still be composite.
Digit Sum Is Preserved by Reversal
Reversing digits does not change their sum. For 149 and 941:
1 + 4 + 9 = 14
9 + 4 + 1 = 14
Divisibility by 3 depends on the digit sum, so a number and its reversal always have the same divisibility status with respect to 3. A candidate greater than 3 whose digits sum to a multiple of 3 cannot be an emirp.
Every Emirp Pair Differs by a Multiple of 18
The differences in the pair table follow a fixed divisibility rule. Reversing decimal digits does not change a number modulo 9 because every power of 10 is congruent to 1 modulo 9.
Reversal Modulo 9
n ≡ R(n) (mod 9)
Therefore n − R(n) is divisible by 9.
Every multi-digit emirp is greater than 2, so both members of the pair are odd primes. The difference between two odd integers is even. The difference is therefore divisible by both 9 and 2.
Emirp Pair Difference
|p − R(p)| is divisible by 18
The first pairs show the rule directly:
- 31 − 13 = 18
- 71 − 17 = 54 = 3 × 18
- 73 − 37 = 36 = 2 × 18
- 701 − 107 = 594 = 33 × 18
- 941 − 149 = 792 = 44 × 18
Being separated by a multiple of 18 does not prove that two reversed numbers are emirps. It is a necessary consequence of an emirp pair, not a sufficient primality test.
Testing 149 and 941
The pair 149 ↔ 941 gives a more useful primality example than the small pair 13 ↔ 31.
Checking 149
The square root of 149 is about 12.21. If 149 were composite, it would have a prime divisor no greater than √149. The relevant possible divisors are therefore 2, 3, 5, 7, and 11.
None divides 149, so 149 is prime.
Checking the Reversal
Reversing the digits produces 941. Its square root is about 30.68, so trial division only needs prime divisors up to that point:
- 2
- 3
- 5
- 7
- 11
- 13
- 17
- 19
- 23
- 29
None divides 941. The reversed value is therefore prime as well.
149 ↔ 941
149 is prime.
941 is prime.
149 ≠ 941.
149 and 941 are an emirp pair.
Test Either Side of an Emirp Pair
A number and its digit reversal can be checked separately for primality. Both values must be prime and different for the original number to be an emirp.
Why Prime Numbers Fail the Emirp Test
A prime can fail after reversal in several distinct ways. Separating these cases makes the definition clearer than treating every failed example as the same type.
| Number | Reversal | Reason |
|---|---|---|
| 23 | 32 | 32 is even and composite. |
| 19 | 91 | 91 = 7 × 13. |
| 101 | 101 | The prime is palindromic, so the reversal is not different. |
| 91 | 19 | The reversal is prime, but 91 itself is composite. |
The 91 → 19 case is especially useful because it shows that the property cannot be checked in only one direction. A prime reversal does not repair a composite starting value.
How Common Are Emirps Among Small Primes?
Emirps form only a subset of prime numbers. Exact counts in small decimal ranges show how the property behaves without implying a formula for larger ranges.
| Digit Length | Inclusive Range | Prime Numbers | Emirps | Emirps Among Primes |
|---|---|---|---|---|
| 2 digits | 10–99 | 21 | 8 | 38.1% |
| 3 digits | 100–999 | 143 | 28 | 19.6% |
| 4 digits | 1,000–9,999 | 1,061 | 204 | 19.2% |
| 5 digits | 10,000–99,999 | 8,363 | 1,406 | 16.8% |
The counts treat each emirp as a number in its own right. Thus 13 and 31 both contribute to the two-digit total. These finite ranges describe the listed intervals only; they do not establish a general density formula for emirps.
Base 10 Is Part of the Definition
An emirp is normally defined by reversing its decimal digits. That detail is mathematically important because digit reversal depends on the numeral system used to write the integer.
The integer itself does not change when another base is used, but its sequence of written digits can change completely. Reversing that new representation can therefore produce a different integer than decimal reversal produces.
Emirp status is representation-dependent. Unless another base is explicitly stated, an emirp refers to reversal in base 10.
Zeros Can Appear Inside an Emirp
A zero inside the decimal representation causes no problem. The pair 107 ↔ 701 is one of the earliest examples.
A multi-digit prime cannot end in 0, so a decimal emirp cannot create an ambiguity from removing a leading zero after reversal. Its final digit must already be one of 1, 3, 7, or 9.
There are also no one-digit emirps under the standard definition. The one-digit primes 2, 3, 5, and 7 reverse to themselves, so each fails the requirement that the reversed prime be different from the original.