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
- Program to check whether a number is Proth number or not
- Check if a number with even number of digits is palindrome or not
- Check if a number is Triperfect Number
- Check whether a number is Non-hypotenuse number
- Check Whether a number is Duck Number or not
- Check if a number is a power of another number
- Check whether the given number is Euclid Number or not
- Check if a number is a Trojan Number
- Check if a number is an Unusual Number or not
- Check if a number is a Mystery Number
- How to check if a given number is Fibonacci number?
- Check if a number is a Krishnamurthy Number or not
- Check if a number is an Achilles 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 firstname.lastname@example.org. 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