Super Prime
Time limit1sMemory limit1024 MB
Given n, print the n-th super prime, where a super prime is a prime whose index among all primes is also prime. Up to 1000 queries with n up to 3000.
- Level
Easy3 of 10
- Topics
- Number theory, Sorting
- Solved
- No attempts yet
Problem
Primes are a central concept for anyone who loves mathematics. A prime is a natural number greater than whose only divisors are and itself. Heujiro thought that some primes are even more special.
Call a prime a super prime if the following holds. Let be the -th smallest of all primes. Then is also prime.
Given an integer , write a program that prints the -th smallest super prime.
Input
The first line contains the number of test cases (). Each of the next lines contains one integer ().
Output
For each test case, print the -th smallest super prime on its own line.