An emirp (prime spelled backward) is a prime number that results in a different prime when its digits are reversed. Note that this definition excludes palindromic numbers from being emirps. The number 13, for example, is an emirp because the number with the same digits in reverse order (31) is also a prime number. The number 23 is not an emirp, notwithstanding the fact that it is a prime number, since the number with the same digits in reverse order (32) is not a prime. Despite the fact that 101 is a prime number, it is not an emirp because it is a palindrome.

Assignment

Example

>>> reversed_number(123)
321
>>> isprime(2)
True
>>> isprime(32)
False
>>> isprime(31)
True
>>> isemirp(13)
True
>>> isemirp(23)
False
>>> isemirp(101)
False