Facebook Pixel

N-th prime

For this question we ask you to compute the n-th prime number.

Input & Output
Input
n — Integer representing the n-th number that should be printed
Output
n-th prime number
Example
Input
n = 3
Output
`5`
Explanation

We want the third prime number which is 5 given that 2, 3 and 5 are the first 3 prime numbers.

Example
Input
n = 5
Output
`11`
Explanation

"11 is the 5th prime number."

Constraints
  • The resulting prime number is guarenteed to be less than 100000

Try it yourself

Invest in Yourself
Your new job is waiting. 83% of people that complete the program get a job offer. Unlock unlimited access to all content and features.
Go Pro