## Access

You are not currently logged in.

Access your personal account or get JSTOR access through your library or other institution:

# Computing $\pi(x)$: The Meissel-Lehmer Method

J. C. Lagarias, V. S. Miller and A. M. Odlyzko
Mathematics of Computation
Vol. 44, No. 170 (Apr., 1985), pp. 537-560
DOI: 10.2307/2007973
Stable URL: http://www.jstor.org/stable/2007973
Page Count: 24
Preview not available

## Abstract

E. D. F. Meissel, a German astronomer, found in the 1870's a method for computing individual values of $\pi(x)$, the counting function for the number of primes $\leqslant x$. His method was based on recurrences for partial sieving functions, and he used it to compute $\pi(10^9)$. D. H. Lehmer simplified and extended Meissel's method. We present further refinements of the Meissel-Lehmer method which incorporate some new sieving techniques. We give an asymptotic running time analysis of the resulting algorithm, showing that for every $\varepsilon > 0$ it computes $\pi(x)$ using at most $O(x^{2/3 + \varepsilon})$ arithmetic operations and using at most $O(x^{1/3 + \varepsilon})$ storage locations on a Random Access Machine (RAM) using words of length $\lbrack \log_2 x \rbrack + 1$ bits. The algorithm can be further speeded up using parallel processors. We show that there is an algorithm which, when given $M$ RAM parallel processors, computes $\pi(x)$ in time at most $O(M^{-1}x^{2/3 + \varepsilon})$ using at most $O(x^{1/3 + \varepsilon})$ storage locations on each parallel processor, provided $M \leqslant x^{1/3}$. A variant of the algorithm was implemented and used to compute $\pi(4 \times 10^{16})$.

• 537
• 538
• 539
• 540
• 541
• 542
• 543
• 544
• 545
• 546
• 547
• 548
• 549
• 550
• 551
• 552
• 553
• 554
• 555
• 556
• 557
• 558
• 559
• 560