TAOCP Section 1.2: Prime Number Sieve
To find all prime numbers less than or equal to a given integer n by Eratosthenes' method, we first create a boolean array representing candidate numbers. We eliminate multiples of each discovered prime until we reach the square root of n.
JavaScript <<1.2>>
// Code will weave here...