Emirp | ||||||
| ||||||
Description | ||||||
An emirp (prime spelled backwards) is a prime number that results in a different prime when its decimal digits are reversed. The first five emirps are 13, 17, 31, 37, 71 Now Kim want to know the kth emirp. Help him. | ||||||
Input | ||||||
The first line is an integer T, describes the number of tests. Then T tests. In each test, one line an integer k. | ||||||
Output | ||||||
For each test, output the kth emirp. | ||||||
Sample Input | ||||||
3 1 2 3 | ||||||
Sample Output | ||||||
13 17 31 | ||||||
Hint | ||||||
T<=10000 k<=1000 思路:就是找大于十的数使其本身和其反置都为素数,并且本身和其反置数不能相同。
|
Emirp
最新推荐文章于 2023-04-12 21:33:15 发布