Your task is to write a program that, for each given, prints the smallest first prime numbers.
The input is a sequence of natural numbers with .
For each , print a line with the first prime numbers, in increasing order, and separated by a comma.
Before reading any , do a sieve of Eratosthenes to precalculate the first 1000 prime numbers. Knowing that 7919 is the prime number 1000 could be useful.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T10:15:58.552Z
© Jutge.org, 2006–2026.
https://jutge.org