Functions
Function-33
Function-34
Function-35
~/algor $ cat problems/funksiya-egizak-tub-sonlar
Is it a twin prime
Medium
2000 ms
128 MB
56%
Write a function IsTwinPrime(x) that returns true if the positive integer $x$ is prime and $x - 2$ or $x + 2$ is prime as well, and false otherwise.
Example 1: IsTwinPrime(13) → true — $11$ and $13$ are primes.
Example 2: IsTwinPrime(23) → false — $23$ is prime, but neither $21$ nor $25$ is prime.
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
23
Output #2
false