19 lines
336 B
Python
19 lines
336 B
Python
def primes(n: int):
|
|
"""Return whether the number is prime for the first n primes."""
|
|
sieve = [True] * n
|
|
|
|
res = []
|
|
|
|
for i in range(2, n):
|
|
if sieve[i]:
|
|
res.append(i)
|
|
for j in range(i * i, n, i):
|
|
sieve[j] = False
|
|
|
|
return res
|
|
|
|
|
|
xs = primes(100)
|
|
ys = primes(200)
|
|
print(xs)
|