Sieve of Eratosthenes

Given several natural numbers, tell which are prime and which are not.

Input

Input consists of (possibly, many) natural numbers n106n \le 10^6.

Output

For each nn, tell if it is prime or not.

Observation

Use the Sieve of Eratosthenes.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:18:04.007Z

© Jutge.org, 2006–2026.
https://jutge.org