Programming Techniques and Data Structures a Sublinear Additive Sieve for Finding Prime Numbers

A new algorithm is presented for the problem of finding all primes between 2 and N. It is based on Mairson's sieve algorithm which uses θ(N) additions and multiplications. The new algorithm improves on this algorithm by using a dynamic sieve technique that avoids most of the nonprimes in the range 2 to N, and by using a tabulation method to simulate multiplications. It is shown to require θ(N/log log N) additions. A related algorithm is outlined that has the same complexity but a storage requirement of only θ(N/log log N) bits.