Emirp Calculator

Number

Emirp verdictYes
Reversed number31
n is primeYes
Reverse is primeYes
How this was calculated
  1. An emirp is a prime that becomes a different prime when its decimal digits are reversed - emirp is 'prime' spelled backwards.
  2. Reversing 13 gives 31.
  3. Primality: 13 is prime and 31 is prime.
  4. Both 13 and its reverse 31 are prime and they differ, so 13 is an emirp.

This emirp calculator identifies emirps and explains why each number is or is not one. An emirp is a prime whose decimal reversal is a different prime; the name is simply "prime" spelled backwards. The calculator reverses the digits of the number you enter and checks both the original number and its reversal for primality. It reports whether the number qualifies as an emirp and shows the reversal it used. The smallest emirp is 13: it is prime, and its reversal, 31, is also prime. By contrast, 23 is not an emirp, because 23 is prime but its reversal, 32, is not prime. The calculator applies the same two-part test to every input, so the distinction is visible rather than assumed.

The method behind the calculator is the accepted standard for this kind of calculation because it follows the definition directly: reverse the digits, then confirm that both the number and its reversal are prime and that the two differ. That last condition matters. 131 is not an emirp even though it is prime, because it is a palindrome, its reversal is itself, and emirps must differ from their reversal. Palindromic primes such as 131 are a separate family and are always excluded from the emirps. This page shows the formula, step-by-step workings, worked examples and sources, so you can follow each check from the digit reversal through the primality tests and see exactly why a number such as 13 is counted and a number such as 23 or 131 is not.

Worked examples

13, the smallest emirp

(13)

Emirp verdictYes
Reversed number31
n is primeYes
Reverse is primeYes

23, whose reverse 32 is not prime

(23)

Emirp verdictNo
Reversed number32
n is primeYes
Reverse is primeNo

131, a palindromic prime

(131)

Emirp verdictNo
Reversed number131
n is primeYes
Reverse is primeYes

What is an emirp?

An emirp is a prime number whose decimal reversal is a different prime. The name itself gives the idea away: emirp is "prime" spelled backwards. To decide whether a number qualifies, you apply a reversal test. First, write the number's digits in reverse order. Second, check whether that reversed number is prime. If both the original number and its reversal are prime, and the two numbers are not the same, the number is an emirp. An emirp calculator runs this test for you, but the logic behind it is simple enough to follow by hand for small numbers.

The smallest emirp is 13. It is prime, and its reversal, 31, is also prime, so 13 passes the test. Not every prime with a prime reversal is an emirp, though, because the two numbers must differ. Consider 131. It is prime, but it is a palindrome: read backwards, it is still 131. Its reversal is itself, not a different prime, so 131 is excluded. Palindromic primes such as 131 form a separate family and are always left out of the emirps.

The other requirement is that the reversal must actually be prime. Take 23. It is prime, but its reversal is 32, and 32 is not prime, so 23 fails the test and is not an emirp. This is where many people slip up: they confirm that the starting number is prime and stop there. The reversal test has two prime checks, not one, and both must succeed.

So an emirp must meet three conditions at once. The number must be prime. Its reversal must be prime. And the reversal must be different from the original number. A number that fails any one of these is not an emirp, no matter how prime it looks at first glance. The two exclusions do most of the work: a prime whose reversal is composite is out, and a palindromic prime whose reversal is itself is out as well.

The examples above show each outcome. 13 is an emirp because it and 31 are both prime and are different numbers. 23 is not an emirp because 32 is composite. 131 is not an emirp because its reversal is itself. Keeping these three cases in mind makes the definition easy to apply to any number you meet.

An emirp needs three things: the number is prime, its reversal is prime, and the reversal is a different number.

Worked examples

A worked example makes the definition concrete. Take 13. First, check whether 13 is prime: it has no divisors other than 1 and itself, so it passes. Next, reverse the digits of 13 to get 31. Check 31 the same way: it is also prime. Finally, confirm the two numbers are different — 31 is not equal to 13. All three conditions hold, so 13 is an emirp. It is, in fact, the smallest emirp, which is why it is the natural first test for any emirp calculator.

Now take 23. The first step passes: 23 is prime. The second step is where it fails. Reversing the digits of 23 gives 32, and 32 is not prime — it is even, so it is divisible by 2. Because the reversal is not prime, 23 cannot be an emirp, no matter how prime the original number is. This example shows why a primality check on the original number alone is never enough: the reversal has to be tested separately.

The third example, 131, tests a different rule. Start with primality: 131 is prime, so it clears the first hurdle. Reverse its digits and you get 131 again — the number reads the same in both directions. That makes 131 a palindrome. The reversal is prime, but it is not a different prime, and emirps must differ from their reversal. So 131 is excluded. Palindromic primes such as 131 form a separate family and are always left out of the emirps.

Putting the three cases side by side shows the full checklist in action: is the number prime, is its reversal prime, and are the two different? A pass on all three makes an emirp; a fail on any one rules the number out. The table below summarizes the results.

NumberPrime?ReversalReversal prime?Different from reversal?Emirp?
13Yes31YesYesYes — smallest emirp
23Yes32NoYesNo
131Yes131YesNo — palindromeNo
13 passes all three checks and is the smallest emirp. 23 fails because its reversal, 32, is not prime. 131 fails because its reversal is itself, and emirps must differ from their reversal.

Emirps vs palindromic primes

Emirps and palindromic primes are easy to confuse because both involve primes that read as primes when reversed. The difference comes down to one rule: an emirp must be a prime whose decimal reversal is a different prime. The word "emirp" is simply "prime" spelled backwards, which is a handy reminder of what the reversal test is checking. A palindromic prime, by contrast, reads the same in both directions, so its reversal is itself. That single distinction keeps the two families entirely separate, and it is why an emirp calculator has to test not just whether the reversal is prime but also whether it differs from the original number.

The smallest emirp is 13. It is prime, and its reversal, 31, is also prime — and because 31 is not the same as 13, the pair qualifies. Notice that 31 is itself an emirp as well: its reversal is 13, a different prime. This is a built-in feature of the definition rather than a coincidence. If a number is an emirp, its reversal is automatically another emirp, so emirps come in pairs (except that no emirp can equal its own reversal, by definition). A tool built around the emirp calculator keyword should make that pairing visible, because it shows why the family is naturally organized in twos.

Not every prime with a prime-looking reversal makes the cut. Take 23: it is prime, but its reversal, 32, is not prime, so 23 is not an emirp. This example is useful because it shows that the reversal test is a genuine filter, not a formality. Many primes fail here simply because their reversed digits form an even number or a number divisible by 5 — any reversal ending in an even digit or a 5 (other than the single-digit case) cannot be prime. That is part of why emirps are less common than primes overall.

Palindromic primes such as 131 sit in a separate family. 131 is prime, but it is not an emirp, because it is a palindrome — its reversal is itself, and emirps must differ from their reversal. Palindromic primes are always excluded from the emirps, no matter how prime their reversal happens to be, since the reversal is the same number. Keeping the two families apart matters when you are counting or listing results: a list of emirps should never contain a palindromic prime, and a list of palindromic primes should never be labeled as emirps. The practical test is short: check that the number is prime, check that its reversal is prime, and check that the reversal is not the number itself. Only numbers that pass all three belong in the emirp family.

  • 13 is an emirp: prime, and its reversal 31 is a different prime.
  • 31 is also an emirp, since its reversal 13 is a different prime — an emirp's reversal is automatically another emirp.
  • 23 is not an emirp: it is prime, but its reversal 32 is not prime.
  • 131 is not an emirp: it is prime, but it is a palindrome, and emirps must differ from their reversal.
  • Palindromic primes are a separate family and are always excluded from the emirps.
Quick rule: a prime qualifies as an emirp only if its reversal is prime AND different from the original number. Palindromic primes fail the second condition, so they never count as emirps.

How large do emirps get?

There is no known largest emirp. Mathematicians conjecture that emirps go on forever, but that statement is a conjecture, not a proved theorem — so no one can point to a final emirp and say the list stops there. What a search for large emirps actually involves is mostly a counting and digit-manipulation problem rather than a factoring problem. To test whether a candidate is an emirp, you reverse its decimal digits and check that the result is a different prime. The reversal step is pure string or digit arithmetic: take the digits, put them in the opposite order, and read off a new number. That is why an emirp calculator can screen candidates quickly — the reversal itself is cheap, and the hard part is confirming primality of the number and of its reversal.

The digit structure of a number shapes whether it can be an emirp at all. A number ending in an even digit or in 5 cannot be prime once it has more than one digit, so any multi-digit emirp must begin and end with digits from the set 1, 3, 7 and 9. Because the reversal swaps the first and last digits, both ends of an emirp have to come from that same set. Palindromes are ruled out by definition: 131 is prime, but its reversal is itself, and an emirp must differ from its reversal. Palindromic primes such as 131 form a separate family and are always excluded from the emirps. So the search space is not all numbers — it is numbers with the right leading and trailing digits, minus the palindromes, checked for primality in both directions.

The small cases show how the definition bites. 13 is the smallest emirp: it is prime, and its reversal 31 is also prime. 23 is not an emirp: 23 is prime, but its reversal 32 is not prime. Those two examples capture the whole test — primality of the number, primality of the reversal, and the two values being different. The name itself is a hint: emirp is "prime" spelled backwards.

Because the conjecture of infinitely many emirps is unproved, treat any statement about how far the sequence extends with care. What can be said is that the search is open-ended and that each new candidate is handled by digit reversal plus primality checks. If you want to explore the sequence yourself, an emirp calculator applies exactly that test to whatever range you give it, so you can see how the candidates thin out as the numbers grow without relying on any claim about a final, largest term.

Emirps are conjectured to be infinite, but this is unproved — no largest emirp is known. Finding them is a digit-reversal and primality problem, not a divisibility search.

FAQs

What is an emirp?

An emirp is a prime number that becomes a different prime when its digits are reversed. The word comes from spelling "prime" backward. For example, 13 and 31 are both prime and differ, so 13 qualifies. A prime whose reversal is itself, like a palindrome, does not count, because the reversed number must be different.

Is 13 an emirp?

Yes. The number 13 is prime, and reversing its digits gives 31, which is also prime. Because 13 and 31 are different numbers, 13 meets the definition of an emirp. This is the classic example, and it shows why emirps come in pairs: 31 is an emirp too.

Is 23 an emirp?

No. Although 23 itself is prime, reversing its digits gives 32. The number 32 is not prime, since it is even and divisible by 2. An emirp requires both the number and its reversal to be prime, so 23 does not qualify. This shows that being prime alone is not enough.

Is 131 an emirp?

No. The number 131 is a palindromic prime, meaning it reads the same forward and backward. Its reversal is itself, and emirps must differ from their reversal. Since 131 and its reversal are the same number, 131 is not an emirp, even though it is prime. The definition requires two distinct primes.

Can an emirp end in an even digit or 5?

No. If an emirp ended in an even digit or 5, its reversal would start with that digit and be divisible by 2 or 5, so it would not be prime. That is why emirps only use the digits 1, 3, 7 and 9 at both ends. This rule helps narrow the search quickly.

Is the reversal of an emirp also an emirp?

Yes. The test is symmetric: if a prime and its reversal are both prime and differ, then reversing again brings you back to the original prime. So emirps come in pairs like 13 and 31. Finding one means its reversal is also an emirp, so the calculator can report them together.

Sources

Related calculators

Prime Number Checker
Is it prime? The verdict, the full prime factorization, the smallest factor, the divisor count and the neighbouring primes on both sides.
Twin Prime Counter
How many twin prime pairs lie at or below a limit, found by sieve, with the largest pair in range and the pair density.
Prime Number Calculator
Primality by trial division, the full prime factorization of composites, and the neighbouring primes on either side.