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 :.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check if a large number is divisible by a number which is a power of 2
- Check if a number is divisible by all prime divisors of another number
- Check if the number is a Prime power 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 ends with another number or not
- Check if a number is Triperfect Number
- Check if a number starts with another number or not
- Check Whether a number is Duck Number or not
- Check if a number is a power of another number
- Check if a number is an Unusual Number or not
- Check if a number is Flavius Number
- Check whether the given number is Euclid Number or not
- Check whether a given number is an ugly number or not
- Check whether given number N is a Moran Number or not
- Check if a number is a Trojan Number
- Check if a number is an Achilles number or not
- How to check if a given number is Fibonacci number?
- Check whether a given number N is a Nude 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