Output the nth prime number, where the 1st prime is 2, the 2nd is 3, the 3rd is 5, and so on.
Input format
One line: a positive integer n.
Output format
One line: the nth prime number.
Constraints
- 1 <= n <= 10000
Output the nth prime number, where the 1st prime is 2, the 2nd is 3, the 3rd is 5, and so on.
One line: a positive integer n.
One line: the nth prime number.
Example 1
Input
1
Expected
2
Explanation
The first prime is 2.
Example 2
Input
5
Expected
11
Explanation
The primes 2,3,5,7,11 make 11 the 5th prime.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →