Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
239 B
1
Indexable
Never
n=int(input())
r=[0]
p=[2]
x=3
while x<=n:
    flag=True
    for i in range(len(r)):
        r[i]=(r[i]+1)%p[i]
        if r[i]==0:
            flag=False
    if flag:
        r.append(0)
        p.append(x)
    x+=1
print(p)