수를 샘플로 뽑아 소수인지 검사하는 프로그램을 작성한다. 작은 소수와 큰 소수의 곱으로 만
들어진 숫자는 물론, 작은 소수, 큰 소수가 샘플에 들어간다.
sequential.py
프로그램을 성능 기준선으로 삼는다. 샘플로 실행한 결과는 다음과 같다.
$ python3 sequential.py
2 P 0.000001s
142702110479723 P 0.568328s
299593572317531 P 0.796773s
3333333333333301 P 2.648625s
3333333333333333 0.000007s
3333335652092209 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.