English

Two Compact Incremental Prime Sieves

Data Structures and Algorithms 2019-02-20 v1 Number Theory

Abstract

A prime sieve is an algorithm that finds the primes up to a bound nn. We say that a prime sieve is incremental, if it can quickly determine if n+1n+1 is prime after having found all primes up to nn. We say a sieve is compact if it uses roughly n\sqrt{n} space or less. In this paper we present two new results: (1) We describe the rolling sieve, a practical, incremental prime sieve that takes O(nloglogn)O(n\log\log n) time and O(nlogn)O(\sqrt{n}\log n) bits of space, and (2) We show how to modify the sieve of Atkin and Bernstein (2004) to obtain a sieve that is simultaneously sublinear, compact, and incremental. The second result solves an open problem given by Paul Pritchard in 1994.

Cite

@article{arxiv.1503.02592,
  title  = {Two Compact Incremental Prime Sieves},
  author = {Jonathan P. Sorenson},
  journal= {arXiv preprint arXiv:1503.02592},
  year   = {2019}
}
R2 v1 2026-06-22T08:47:50.691Z