Fast Compact Prime Number Sieves (among Others)

Abstract A parameterized family of algorithms is presented for the problem of finding all prime numbers up to a limit N. Many previous algorithms for this problem are shown to correspond to members of this family. A particular choice of parameters leads to an algorithm that requires only Θ(N) additions and that runs in o( N ) bits. The small storage requirement is made possible by a provably compact method of storing all the primes up to some limit.