소수찾기 알고리즘
import math
def solution(N):
arr = [True] * (N + 1)
for i in range(2, int(math.sqrt(N)) + 1):
if arr[i]:
j = 2
while i * j <= N:
arr[i * j] = False
j += 1
for i in range(2, N + 1):
if arr[i]:
print(i, end=' ')
solution(1000)