mirror of
https://github.com/heqin-zhu/algorithm.git
synced 2024-03-22 13:30:46 +08:00
11 lines
282 B
Python
11 lines
282 B
Python
|
def get(n)
|
||
|
li = [i for i in range(2,n)]
|
||
|
i = 1
|
||
|
while i <len(li):
|
||
|
prod =2 * li[i]
|
||
|
while prod <=li[-1]:
|
||
|
if prod in li:
|
||
|
li.remove(prod)
|
||
|
prod+=li[i]
|
||
|
i+=1
|
||
|
return li
|