You are given a natural number n. Print all the prime numbers in the range of [1,n].
In the first line, a natural number n(1≤n≤5∗105).
All prime numbers should be printed on a single line, separated by spaces.
10
2 3 5 7
Login to be able to submit.