An Emirp Number (prime spelled backwards) is a prime number that results in a different prime when its decimal digits are reversed. This definition excludes the related palindromic primes.
Input : n = 13 Output : 13 is Emirp! Explanation : 13 and 31 are both prime numbers. Thus, 13 is an Emirp number. Input : n = 27 Output : 27 is not Emirp.
Objective : Input a number and find whether the number is an emirp number or not.
Approach : Input a number and firstly check if its a prime number or not. If the number is a prime number, then we find the reverse of the original number and check the reversed number for being prime or not. If the reversed number is also prime, then the original number is an Emirp Number otherwise it is not.
Below is the implementation of above approach :.
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check if a number is divisible by all prime divisors of another number
- Check if a number with even number of digits is palindrome or not
- Program to check whether a number is Proth number or not
- Check if a number is a Trojan Number
- Check if a number is a Mystery Number
- Check if a number is an Achilles number or not
- Check whether the given number is Euclid Number or not
- How to check if a given number is Fibonacci number?
- Check if a number is an Unusual Number or not
- Check if a number is a power of another number
- Check Whether a number is Duck Number or not
- Check if a number is Flavius Number
- Check whether a number is Non-hypotenuse number
- Check if a number is a Krishnamurthy Number or not
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t