Find the Nth Prime Number
Given a positive integer n, return the nth prime number. Prime positions are one-based: the first prime is 2, the second is 3, and the sixth is 13.
Given a positive integer `n`, return the `n`th prime number. Prime positions are one-based: the first prime is `2`, the second is `3`, and the sixth is `13`.
- `1 ≤ n ≤ 50` - `n` is an integer.
Example 1: input n = 1; output 2. Two is the first prime number.
Example 2: input n = 6; output 13. The first six primes are 2, 3, 5, 7, 11, and 13.
Example 3: input n = 10; output 29. Twenty-nine is the tenth prime number.
Category: Math. Topic: math. Difficulty: Easy. Patterns: math.