Number Theory

Analytic Number Theory and How Calculus Studies Whole Numbers

See how limits, integrals and complex functions answer questions about primes, divisors and sums that counting alone cannot.

Key takeaways

  • Analytic number theory replaces exact questions about single integers with estimates of counts and averages.
  • The prime number theorem says the number of primes up to x is approximately x divided by the natural logarithm of x.
  • Functions such as the Riemann zeta function turn facts about primes into facts about a complex function.
  • Every estimate has a main term and an error term, and much research aims to shrink the error.
  • Sieve methods and the circle method attack additive problems, including gaps between primes and sums of primes.

Analytic number theory studies the whole numbers with the tools of calculus and analysis: limits, infinite series, integrals and functions of a complex variable. Its typical question is not whether one particular number has a property, but how many numbers up to a large bound have it, and how accurate an estimate can be.

That seems an odd match, since calculus deals with smooth change and the integers come in separate steps. The bridge is averaging. Individual primes or divisors behave erratically, yet totals over long ranges follow smooth laws.

From counting to estimating

Let π(x) denote the number of primes not exceeding x. (This π is a function name, unrelated to the circle constant.) Exact values jump unpredictably, but a smooth curve tracks them well.

x π(x) x / ln x (rounded) Ratio of the two
100 25 21.7 1.15
1,000 168 144.8 1.16
1,000,000 78,498 72,382 1.08

The prime number theorem states that the ratio tends to 1 as x grows. Jacques Hadamard and Charles de la Vallée Poussin proved it independently in 1896. A better approximation is the logarithmic integral, the area under 1/ln t from 2 up to x, which misses π(1,000,000) by only about 130. See how primes thin out.

Asymptotic language

The statements of this subject use a compact notation. Writing f(x) ~ g(x) means f(x)/g(x) tends to 1. Writing f(x) = g(x) + O(h(x)) means the difference between f and g is at most a constant multiple of h(x) for all large x.

The first part, g, is the main term, and the O part is the error term. A theorem with a smaller error term is a stronger theorem. The same notation is used to measure algorithms, as in big O from a mathematical point of view.

An asymptotic statement says nothing by itself about small x. It may become accurate only far beyond any range you can compute, unless the constants are made explicit.

A worked example: counting divisors

Let d(n) be the number of positive divisors of n. Its values bounce around: d(11) = 2, d(12) = 6, d(13) = 2. What is its average?

Instead of finding the divisors of each n, count for each k how many n ≤ x are multiples of k. There are about x/k of them.

d(1) + d(2) + ... + d(x)
    = sum over k ≤ x of (number of multiples of k up to x)
    ≈ x/1 + x/2 + x/3 + ... + x/x
    ≈ x ln x

So the average value of d(n) up to x is about ln x. Dirichlet refined the estimate to ln x + 2γ − 1, where γ ≈ 0.5772 is the Euler–Mascheroni constant. For x = 10 the true total is 27, an average of 2.7, against a prediction of about 2.46. For x = 100 the true average is 4.82 against about 4.76.

The error in this formula is the subject of the Dirichlet divisor problem. Finding its exact order of size remains open.

Lattice points and areas

Count the points with whole-number coordinates inside a circle of radius r centered at the origin. Each point can be matched with a unit square, so the count is close to the area, πr².

The error comes from squares cut by the boundary, so it is at most a constant times r. In fact it is much smaller than that, thanks to cancellation, and the Gauss circle problem asks how small. This is also still open.

The pattern recurs throughout the subject: a geometric or integral main term is easy, and the fluctuation around it is deep.

The zeta function

For s > 1, the Riemann zeta function is the sum 1/1ˢ + 1/2ˢ + 1/3ˢ + .... Euler showed that it also equals a product over primes, because every integer factors uniquely. The Euler product explains this in detail.

In 1859 Bernhard Riemann treated s as a complex number and extended the function beyond the region where the sum converges. He found that the places where it equals zero control the error in counting primes.

The prime number theorem is equivalent to the statement that zeta has no zeros with real part exactly 1. The Riemann hypothesis asserts far more, that all the nontrivial zeros have real part 1/2. It remains unproved as of the mid-2020s, and what the zeros say about primes shows why it matters.

A typical argument in analytic number theory
1 Arithmetic question How many integers up to x have a property? 2 Encode Build a series or exponential sum that records the property 3 Analyze Study the function with integrals and complex analysis 4 Main term The dominant singularity gives the smooth law 5 Bound the error Show everything else is smaller Arithmetic question How many integers up to x have a property? 1 Encode Build a series or exponential sum that records the property 2 Analyze Study the function with integrals and complex analysis 3 Main term The dominant singularity gives the smooth law 4 Bound the error Show everything else is smaller 5

Proving something about primes with a series

Here is the smallest complete example of the method, in outline. Euler's identity says that for s > 1 the sum over all integers equals the product over primes of 1/(1 − p^(−s)).

Now let s decrease toward 1. The sum on the left grows without bound, because the harmonic series diverges. If there were only finitely many primes, the product on the right would approach a finite number. So there are infinitely many primes.

Taking logarithms gets more. The logarithm of the product is the sum over primes of 1/pˢ plus a remainder that stays bounded. Since the left side blows up, the sum of 1/p over all primes diverges.

That is a statement about density. The sum of the reciprocals of the squares converges, so in this sense primes are far more plentiful than squares, even though there are infinitely many of both. A counting argument alone, such as Euclid's proof, does not reveal that.

Chebyshev's step

Before the full prime number theorem, Pafnuty Chebyshev showed around 1850 that π(x) is trapped between two constant multiples of x / ln x for all large x, with constants fairly close to 1.

One key idea is accessible with school algebra. The central binomial coefficient C(2n, n) lies between 4ⁿ/(2n + 1) and 4ⁿ. Every prime between n and 2n divides it, since such a prime appears in (2n)! but not in n!. So the product of those primes is at most 4ⁿ.

Taking logarithms limits how many primes can sit in that interval. A closer look at the powers of all primes dividing the coefficient gives a bound in the other direction.

Primes in progressions

The starting point of the field is usually taken to be Dirichlet's work of 1837. He proved that if a and q share no common factor, then there are infinitely many primes of the form a + qk.

His method introduced characters, functions that pick out remainder classes, and the associated L-functions, relatives of zeta. The key difficulty was showing that a certain value L(1) is not zero. The theorem and its meaning are covered in primes in arithmetic progressions.

Sieves and the circle method

A sieve starts with a set of integers and removes those divisible by small primes, keeping track of how many survive. Modern sieves give upper bounds and partial results where exact counts are out of reach.

In 2013 Yitang Zhang proved that infinitely many pairs of primes differ by less than 70 million. James Maynard, with a different sieve, and a collaborative Polymath project soon brought the bound down to 246. The twin prime conjecture, with gap 2, remains open as of the mid-2020s.

The circle method, developed by Hardy, Ramanujan and Littlewood, writes the number of solutions of an additive equation as an integral of exponential sums. Ivan Vinogradov used related ideas in 1937 to show that every sufficiently large odd number is a sum of three primes. Harald Helfgott later announced a proof covering all odd numbers greater than 5.

What a beginner needs

To enter the subject you need solid single-variable calculus, comfort with convergence of series, and elementary number theory including congruences. Complex analysis comes next.

A good first exercise is to prove that the harmonic sum 1 + 1/2 + ... + 1/n differs from ln n by a bounded amount, by comparing rectangles with the area under 1/x. The limit of the difference is γ.

A second is to verify the partial summation idea: if you know how a count A(x) grows, you can estimate weighted sums over the same set by integrating. Much of the daily work of the field consists of this kind of careful bookkeeping.

What the methods cannot do

Averages say little about a single case. Knowing that primes near x have an average spacing of about ln x does not tell you where the next one is.

Numerical evidence can also mislead. For all values of x that have been computed directly, the logarithmic integral exceeds π(x), yet Littlewood proved that the difference changes sign infinitely often. The first change happens at a number far too large to reach by listing primes.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 59 articles in Number Theory →

Latest news on this topic