# Definition:Prime-Counting Function

## Definition

The prime-counting function is the function $\pi: \R \to \Z$ which counts the number of primes less than or equal to some real number.

That is:

$\displaystyle \forall x \in \R: \map \pi x = \sum_{\substack {p \mathop \in \mathbb P \\ p \mathop \le x} } 1$

where $\mathbb P$ denotes the set of prime numbers.

### Examples

The values of the prime-counting ($\pi$) function for the first few integers are as follows:

$n$ $\map \pi n$
$1$ $0$
$2$ $1$
$3$ $2$
$4$ $2$
$5$ $3$
$6$ $3$
$7$ $4$
$8$ $4$

### Approximations

A table of some of the values of the prime-counting ($\pi$) function compared with $\dfrac x {\ln x}$ and the Eulerian logarithmic integral $\displaystyle \map \Li x = \int_2^x \frac {\d t} {\map \ln t}$:

$n$ $\map \pi n$ $\dfrac x {\ln x}$ $\map \Li x$
$1 \, 000$ $168$ $145$ $178$
$10 \, 000$ $1 \, 229$ $1 \, 068$ $1 \, 246$
$100 \, 000$ $9 \, 596$ $8 \, 686$ $9 \, 630$
$1 \, 000 \, 000$ $78 \, 498$ $72 \, 382$ $78 \, 628$
$10 \, 000 \, 000$ $664 \, 579$ $620 \, 421$ $664 \, 918$

## Also defined as

Some sources give both the domain and codomain as $\N$, thus:

$\pi: \N \to \N$

## Also known as

Some sources merely call this the $\pi$ function.