Publication [5.4] of Tomás Oliveira e Silva

Do not bookmark this page, because its URI may change in the future.
Instead, bookmark its parent page (


Tomás Oliveira e Silva, "Computing π(x): the Combinatorial Method," Revista do DETUA, vol. 4, no. 6, pp. 759-768, Mar. 2006.


This article presents a self-contained description of the method proposed by Deléglise and Rivat -- which has roots on earlier work by Meissel, by Lehmer, and by Lagarias, Miller and Odlyzko -- to compute π(x), which is the number of primes not larger than x. To make life easier to programmers, the major parts of the computation of π(x) are also presented in algorithmic form. The more interesting low-level computational details are presented in the form of C code fragments.

BibTeX entry

  author = {Oliveira e Silva, Tom{\'a}s},
  title = {Computing $\pi(x)$: the Combinatorial Method},
  journal = {Revista do DETUA},
  year = {2006},
  volume = {4},
  number = {6},
  pages = {759--768},
  month = Mar


An electronic copy of this publication is available in the following formats: