10000以内的素数:
[x for x in range(2,10000) if not [i for i in range(2,x) if x % i == 0 ] ]
reduce( lambda s, x: s+ ([x] if all([x %i for i in s]) else []),
range(2,10000), [])
[2]+[d for d in range(3, 10000, 2) if 2 ** (d -1) %d == 1]
python求素数
最新推荐文章于 2023-09-25 18:44:44 发布