에라스토테네스의 체 자연수를 순서대로 늘어놓은 표에서 합성수를 차례로 지워나가면서 소수 목록을 얻는 알고리즘. 위키피디아에서 가져온 에라스토테네스의 체 알고리즘의 pseudocode는 이런 방식이다. input을 n이라고 할 때, 검사는 1 ~ n이 아닌 1 ~ n의 제곱근까지만 하면 된다. 어차피 n보다 크면 n보다 작은 수로 합성수를 찾아낼 때 이미 걸려지기 때문이다. algorithm Sieve of Eratosthenes is input: an integer n > 1. output: all prime numbers from 2 through n. let A be an array of Boolean values, indexed by integers 2 to n, initially all set t..