LearnPy Hub
← Iterators & Generators problems
Hard

Prime Generator

Write an infinite generator of primes. Print the n-th prime (1-based).

Input

One integer n ≥ 1.

Output

The n-th prime.

Sample 1

Input
1
Output
2

Sample 2

Input
10
Output
29
solution.py
Output appears here
Prime Generator · Python practice problem · LearnPy Hub