LearnPy Hub
← Loops problems
Hard

List the Primes

Read n and print all prime numbers up to n on one line, separated by spaces.

Input

One integer n ≥ 2.

Output

One line.

Sample 1

Input
20
Output
2 3 5 7 11 13 17 19

Sample 2

Input
2
Output
2
solution.py
Output appears here
List the Primes · Python practice problem · LearnPy Hub