#K72452. Find the N-th Prime Number
Find the N-th Prime Number
Find the N-th Prime Number
This problem requires you to compute the n-th prime number. You are given an integer \( n \) (with \( n \ge 1 \)). Your task is to output the prime number that appears in the \( n \)-th position in the sequence of prime numbers (i.e. \( 2, 3, 5, 7, \ldots \)). If the input is not a positive integer, output "Error".
inputFormat
The input consists of a single integer \( n \) read from stdin. For example: 10
.
outputFormat
Output a single line with the \( n \)-th prime number to stdout. If \( n \) is not a positive integer, output Error
.
1
2