Functions
Function-45
Function-46
Function-47
~/algor $ cat problems/funksiya-emirp-sonlar
Is it an emirp
Medium
2000 ms
128 MB
66%
Write a function IsEmirp(x) that returns true if the positive integer $x$ is an emirp and false otherwise. A prime is an emirp if writing its digits in reverse order gives a different prime.
Example 1: IsEmirp(13) → true — both $13$ and $31$ are prime.
Example 2: IsEmirp(11) → false — $11$ reads the same when reversed.
Write only the function body.
Input
One line with a positive integer $x$ — the argument of the function.
Output
The value returned by the function: true or false.
Note
$1 \le x \le 10^{5}$
Examples
Input #1
13
Output #1
true
Input #2
11
Output #2
false