# Pi(x) Prime counting function

Pi(x) = Number of primes <= x. It can be computed by verious methods.

Here are some notes from my integer calculator program XICalc:

Pi(X) = Number of primes <= X by sieve or Lehmer:
This is the prime counting function, for every real x >= 0, Pi(x) is the number of primes p such that p <= x. For example Pi(5) = Pi(6) = 3. The 3 primes are 2, 3, and 5. For small x, the sieve of Eratosthenes is used, for large x, Lehmer's formula is used. This is the method to use unless you are testing PiL1(x) (slowest), PiM(x) (slow), or PiL(x) (fastest for large x).

See: Sieve of Eratosthenes -- From MathWorld

PiL(X) = number of primes <= X by Lehmer's formula:
This is the prime counting function using Lehmer's formula. This is the fastest of the three functions PiL1(x), PiM(x), and PiL(x).

See: Lehmer's Formula -- From MathWorld

PiL1(X) = number of primes <= X by Legendre's formula:
This is the prime counting function using Legendre's formula.

See: Legendre's Formula -- From MathWorld

PiM(X) = number of primes <= X by Meissel's formula:
This is the prime counting function using Meissel's formula.

See: Meissel's Formula -- From MathWorld

See: Results and current computations -- From The pi(x) project
See: Sequence A006880 -- From The On-Line Encyclopedia of Integer Sequences!
See: Prime Counting Function -- From MathWorld
And: Wolfram Functions Site -- PrimePi[x]

This page accessed times since July 27, 2007.
Page created by: hjsmithh@sbcglobal.net
Changes last made on Monday, 06-Aug-07 20:47:29 PDT