Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
178 B
1
Indexable
Never
n=int(input())
num=[1]*(n-1)
for i in range(len(num)):
  if num[i]==1:
    print(i+2,end=" ")
    for j in range(i,len(num),i+2):
      if (j+2)%(i+2)==0:
        num[j]=0