Abstract
The function π(x), which counts the number of primes p ≤ x, has been cited as being difficult to compute. None of the published methods for evaluating π(x) are substantially faster than finding all the primes ≤ x. This paper describes two new algorithms for computing π(x). One of them, due to V. S. Miller and the authors, is based on combinatorial sieving ideas and computes π(x) in time O (x 2/3+ε) and space O (x 1/3+ε), for any ε > 0. The other algorithm, based on numerical evaluation of integral transforms, computes π(x) in time O (x 3/5+ε) and space O (x ε), for any ε > 0.
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
L. M. Adleman, On distinguishing prime numbers from composite numbers, Proc. 21-st IEEE Symp. on Foundations of Computer Science, 1980, 387–406.
L. M. Adleman, C. Pomerance, and R. S. Rumely, On distinguishing prime numbers from composite numbers, Annals of Math., to appear.
A. Aho, J. Hopcroft, and J. Ullmann, The Design and Analysis of Computer Algorithms, Addison-Wesley Publ. Co., Reading, Mass. 1974.
J. Bohman, On the number of primes less than a given limit, BIT 12 (1972), 576–577.
L. E. Dickson, History of the Theory of Numbers, Chelsea reprint. Vol. 1, Chapter XVIII.
H. M. Edwards, Riemann's Zeta Function, Academic Press, 1974.
G. H. Hardy, Ramanujan, Cambridge Univ. Press, 1940. (Reprinted by Chelsea.)
R. A. Hudson and A. Brauer, On the exact number of primes in the arithmetic progressions: 4n±1 and 6n±1, J. reine angew. Math. 291 (1977), 23–29.
J. C. Lagarias, V. S. Miller, and A. M. Odlyzko, Computing π(x): The Meissel-Lehmer method, preprint.
J. C. Lagarias and A. M. Odlyzko, Computing π(x): An analytic method, preprint.
D. H. Lehmer, On the exact number of primes less than a given limit, Illinois J. Math. 3 (1959), 381–388.
D. C. Mapes, Fast method of computing the number of primes less than a given limit, Math. Comp. 17 (1963), 179–185.
E. D. F. Meissel, Uber die Bestimmung der Primzahlmenge innerhalb gegebener Grenzen, Math. Annalen, 2 (1870), 636–642.
E. D. F. Meissel, Berechnung der Menge der Primzahlen, welche innerhalb der ersten Milliarde natürlichen Zahlen vorkommen, Math. Annalen, 25 (1885), 251–257.
P. Pritchard, A sublinear additive sieve for finding prime numbers, Comm. ACM 24 (1981), 18–23.
S. Ramanujan, Notebooks, Tata Institute, 1957, 3rd notebook, p. 371.
H. Riesel and G. Göhl, Some calculations related to Riemann's prime number formula, Math. Comp. 24 (1970), 969–983.
C. L. Siegel, Uber Riemanns Nachlass zur analytischen Zahlentheorie, Quellen und Studies zur Geschichte Math. Astr. Phys. 2 (1931), 45–80. Reprinted in C. L. Siegel, Gesammelte Abhandlungen, Springer-Verlag, 1966, Vol. 1, pp. 275–310.
E. C. Titchmarsh, The Theory of the Riemann Zeta Function, Oxford Univ. Press, 1951.
J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, New York: McGraw-Hill Book Co., 1939, cf. pp. 114–125.
H. S. Wilf, What is an answer?, Amer. Math. Monthly, 89 (1982), 289–292.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1984 Springer-Verlag
About this paper
Cite this paper
Lagarias, J.C., Odlyzko, A.M. (1984). New algorithms for computing π(x). In: Chudnovsky, D.V., Chudnovsky, G.V., Cohn, H., Nathanson, M.B. (eds) Number Theory. Lecture Notes in Mathematics, vol 1052. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0071543
Download citation
DOI: https://doi.org/10.1007/BFb0071543
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-12909-7
Online ISBN: 978-3-540-38788-6
eBook Packages: Springer Book Archive
