#K68252. Sum of Consecutive Primes
Sum of Consecutive Primes
Sum of Consecutive Primes
Given a non-negative integer n, your task is to compute the sum of the first n prime numbers. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In particular, if n is 0, then the sum should be 0.
The formula for the sum when n > 0 can be expressed as:
where \( p_i \) denotes the i-th prime number.
You are required to read the input from standard input (STDIN) and output the result to standard output (STDOUT).
inputFormat
The input consists of a single line containing an integer n (0 \( \leq n \leq 10^5 \) for example) which represents the number of consecutive prime numbers to sum up.
outputFormat
Output a single integer, which is the sum of the first n consecutive prime numbers.
## sample1
2