---
tag: 0XRJB5SSNE
kind: definition
name: Prime-counting function
msc: [11N05]
defines: 0RQSNVTFVZ
uses: [0SN0MAEKYX]
sources:
  - url: https://en.wikipedia.org/wiki/Prime-counting_function
    locator: lead section
---

## Definition

For a real number $x$, the prime-counting function $\pi(x)$ is the number of [[prime numbers|0SN0MAEKYX]] $p$ with $p \le x$.

## Remarks

For example, $\pi(10) = 4$, because the primes up to $10$ are $2, 3, 5, 7$. Also $\pi(100) = 25$.
The function is a step function. It increases by $1$ at each prime.
The [[prime number theorem|0EHBY5Y84N]] says that $\pi(x)$ grows like $x / \ln x$.
The symbol $\pi$ here has no relation to the number $3.14159\dots$.

## Explanations

### L1 human

The function $\pi(x)$ answers the question: how many primes are there up to $x$?
The answer grows without bound, by [[Euclid's theorem|0292EPPPT0]], but the primes become rarer as $x$ grows.
