ArticleslgStudy

mathematics

Prime-counting function

Prime-counting function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Prime-counting function rather than just read about it. In short: In mathematics, the prime-counting function is the function counting the number of prime numbers less than or equal to some real number x. It is denoted by π(x) (unrelated to the number π).

Prime-counting function — main illustration
Prime-counting function — illustration

Key takeaways

  • Prime-counting function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Prime-counting function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Prime-counting function from memory before moving on to harder problems.

Reference excerpt

In mathematics, the prime-counting function is the function counting the number of prime numbers less than or equal to some real number x. It is denoted by π(x) (unrelated to the number π). A symmetric variant seen sometimes is π0(x), which is equal to π(x) − 1⁄2 if x is exactly a prime number, and equal to π(x) otherwise. That is, the number of prime numbers less than x, plus half if x equals a prime.

Growth rate

Of great interest in number theory is the growth rate of the prime-counting function. It was conjectured in the end of the 18th century by Gauss and by Legendre to be approximately

x log ⁡ x {\displaystyle {\frac {x}{\log x}}}

where log is the natural logarithm, in the sense that

lim x → ∞ π ( x ) x / log ⁡ x = 1. {\displaystyle \lim _{x\rightarrow \infty }{\frac {\pi (x)}{x/\log x}}=1.}

This statement is the prime number theorem. An equivalent statement is

lim x → ∞ π ( x ) li ⁡ ( x ) = 1 {\displaystyle \lim _{x\rightarrow \infty }{\frac {\pi (x)}{\operatorname {li} (x)}}=1}

where li is the logarithmic integral function. The prime number theorem was first proved in 1896 by Jacques Hadamard and by Charles de la Vallée Poussin independently, using properties of the Riemann zeta function introduced by Riemann in 1859. Proofs of the prime number theorem not using the zeta function or complex analysis were found around 1948 by Atle Selberg and by Paul Erdős (for the most part independently).

More precise estimates In 1899, de la Vallée Poussin proved that

π ( x ) = li ⁡ ( x ) + O ( x e − a log ⁡ x ) as x → ∞ {\displaystyle \pi (x)=\operatorname {li} (x)+O\left(xe^{-a{\sqrt {\log x}}}\right)\quad {\text{as }}x\to \infty }

for some positive constant a. Here, O(...) is the big O notation. More precise estimates of π(x) are now known. For example, in 2002, Kevin Ford proved that

π ( x ) = li ⁡ ( x ) + O ( x exp ⁡ ( − 0.2098 ( log ⁡ x ) 3 / 5 ( log ⁡ log ⁡ x ) − 1 / 5 ) ) . {\displaystyle \pi (x)=\operatorname {li} (x)+O\left(x\exp \left(-0.2098(\log x)^{3/5}(\log \log x)^{-1/5}\right)\right).}

Mossinghoff and Trudgian proved an explicit upper bound for the difference between π(x) and li(x):

| π ( x ) − li ⁡ ( x ) | ≤ 0.2593 x ( log ⁡ x ) 3 / 4 exp ⁡ ( − log ⁡ x 6.315 ) for x ≥ 229. {\displaystyle {\bigl |}\pi (x)-\operatorname {li} (x){\bigr |}\leq 0.2593{\frac {x}{(\log x)^{3/4}}}\exp \left(-{\sqrt {\frac {\log x}{6.315}}}\right)\quad {\text{for }}x\geq 229.}

For values of x that are not unreasonably large, li(x) is greater than π(x). However, π(x) − li(x) is known to change sign infinitely many times. For a discussion of this, see Skewes' number.

Exact form For x > 1 let π0(x) = π(x) − ⁠1/2⁠ when x is a prime number, and π0(x) = π(x) otherwise. Bernhard Riemann, in his work On the Number of Primes Less Than a Given Magnitude, proved that π0(x) is equal to

π 0 ( x ) = R ⁡ ( x ) − ∑ ρ R ⁡ ( x ρ ) , {\displaystyle \pi _{0}(x)=\operatorname {R} (x)-\sum _{\rho }\operatorname {R} (x^{\rho }),}

where

… excerpt ends here. Continue reading the full article.

Illustrations

Prime-counting function: The values of π(n) for the first 60 positive integers
The values of π(n) for the first 60 positive integers
Prime-counting function: Riemann's explicit formula using the first 200 non-trivial zeros of the zeta function
Riemann's explicit formula using the first 200 non-trivial zeros of the zeta function
Prime-counting function: Graph showing ratio of the prime-counting function π(x) to two of its approximations, ⁠x/log x⁠ and Li(x). As x increases (note x-axis is logarithmic), both ratios tend towards 1. The ratio for ⁠x/log x⁠ converges from above very slowly, while the ratio for Li(x) converges more quickly from below.
Graph showing ratio of the prime-counting function π(x) to two of its approximations, ⁠x/log x⁠ and Li(x). As x increases (note x-axis is logarithmic), both ratios tend towards 1. The ratio for ⁠x/log x⁠ converges from above very slowly, while the ratio for Li(x) converges more quickly from below.

Worked examples

Example 1 — a first encounter with Prime-counting function

Start with the simplest possible case. Write down what Prime-counting function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Prime-counting function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Prime-counting function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Prime-counting function

In research
Prime-counting function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Prime-counting function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Prime-counting function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Analytic number theory, Arithmetic functions, Prime numbers, so understanding it makes those chapters shorter.
In everyday life
Look for Prime-counting function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Prime-counting function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Prime-counting function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Prime-counting function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Prime-counting function in simple terms?

In mathematics, the prime-counting function is the function counting the number of prime numbers less than or equal to some real number x. It is denoted by π(x) (unrelated to the number π).

Why does Prime-counting function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Prime-counting function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Prime-counting function.

Tags

  • Analytic number theory
  • Arithmetic functions
  • Prime numbers

Keep exploring