Dissecting a Sieve to Cut Its Need for Space

  • William F. Galway
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1838)


We describe a “dissected” sieving algorithm which enumerates primes in the interval [x1, x2], using \(O(x_{2}^{1/3})\) bits of memory and using \(O(x_{2} -- x_{1} + x^{1/3}_{2}\) arithmetic operations on numbers of \(O(\rm ln \it x_{2})\) bits. This algorithm is based on a recent algorithm of Atkin and Bernstein [1], modified using ideas developed by Voronoï for analyzing the Dirichlet divisor problem [20]. We give timing results which show our algorithm has roughly the expected running time.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Atkin, A.O.L., Bernstein, D.J.: Prime sieves using binary quadratic forms, Dept. of Mathematics, Statistics, and Computer Science, University of Illinois, Chicago, 60607-7045 (1999); Preprint available at, http://pobox.com/~djb/papers/primesieves.dvi
  2. 2.
    Deléglise, M., Rivat, J.: Computing π(x): the Meissel, Lehmer, Lagarias, Miller, Odlyzko method. Mathematics of Computation 65(213), 235–245 (1996)MATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Dowd, K., Severance, C.R.: High performance computing, 2nd edn. O’Reilly and Associates, Inc., 101 Morris Street, Sebastopol, CA 95472 (1998)Google Scholar
  4. 4.
    Galway, W.F.: Robert Bennion’s hopping sieve. In: Buhler, J.P. (ed.) ANTS 1998. LNCS, vol. 1423, pp. 169–178. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  5. 5.
    Galway, W.F.: Analytic computation of the prime-counting function, Ph.D. thesis, University of Illinois at Urbana-Champaign, expected (2000)Google Scholar
  6. 6.
    Hardy, G.H., Wright, E.M.: An introduction to the theory of numbers, 5th edn. Oxford University Press, Oxford (1979)MATHGoogle Scholar
  7. 7.
    Huxley, M.N.: Area, lattice points, and exponential sums, London Mathematical Society Monographs. New Series, vol. 13. The Clarendon Press, Oxford University Press, Oxford Science Publications (1996)Google Scholar
  8. 8.
    Ivić, A.: The Riemann zeta-function. John Wiley & Sons, New York (1985)MATHGoogle Scholar
  9. 9.
    Knuth, D.E.: The art of computer programming, 2nd edn. Fundamental Algorithms, vol. 1. Addison-Wesley, Reading (1973)Google Scholar
  10. 10.
    Lagarias, J.C., Miller, V.S., Odlyzko, A.M.: Computing π(x): The Meissel- Lehmer method. Mathematics of Computation 44(170), 537–560 (1985)MATHMathSciNetGoogle Scholar
  11. 11.
    Lagarias, J.C., Odlyzko, A.M.: Computing π(x): an analytic method. Journal of Algorithms 8(2), 173–191 (1987)MATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Lehmer, D.H., Lehmer, E.: A new factorization technique using quadratic forms. Mathematics of Computation 28, 625–635 (1974)MATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Nicely, T.R.: Enumeration to 10 14 of the twin primes and Brun’s constant. Virginia J. Sci. 46(3), 195–204 (1995)MathSciNetGoogle Scholar
  14. 14.
    Nicely, T.R.: New maximal prime gaps and first occurrences. Mathematics of Computation 68(227), 1311–1315 (1999)MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Riesel, H.: Prime numbers and computer methods for factorization, 2nd edn. Progress in Mathematics, vol. 126. Birkhäuser, Basel (1994)MATHGoogle Scholar
  16. 16.
    Sierpiński, W.: Sur un probléme du calcul des fonctions asymptotiques,1906, Oeuvres choisies, Tome I, PWN—Éditions Scientifiques de Pologne, Warsaw, pp. 73–108 (1974)Google Scholar
  17. 17.
    Sorenson, J.P.: Trading time for space in prime number sieves. In: Buhler, J.P. (ed.) ANTS 1998. LNCS, vol. 1423, pp. 179–195. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  18. 18.
    Tenenbaum, G.: Introduction to analytic and probabilistic number theory. Cambridge University Press, Cambridge (1995)Google Scholar
  19. 19.
    van der Corput, J.G.: Über Gitterpunkte in der Ebene. Mathematische Annalen 81, 1–20 (1920)MATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    Voronoï, G.: Sur un probléme du calcul des fonctions asymptotiques. J. Reine Angew. Math. 126, 241–282 (1903)MATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • William F. Galway
    • 1
  1. 1.Department of MathematicsUniversity of Illinois at Urbana-ChampaignUrbanaUSA

Personalised recommendations