betaFeedback

WorksMathematics

The Riemann Hypothesis and Prime Numbers

Abstract

The Riemann hypothesis is attracting a great deal of attention at present. It is one of the seven Millennium Prize Problems in mathematics, for each of which the Clay Mathematics Institute offers a prize of one million dollars. It is arguably the most important open problem in all of mathematics. Numerous results have so far been proved only under the assumption of the Riemann hypothesis. Yet the hypothesis itself sounds rather dull: it conjectures that the zeros of a certain function have a certain form. Things become truly exciting, however, when we look at its connection with prime numbers, and that is what we shall do here.

Prime Numbers

We begin with a definition: a natural number aa divides a natural number bb if there is a natural number cc such that b=a⋅cb = a \cdot c. We write a∣ba|b. Prime numbers are natural numbers with exactly two positive divisors. Thus, the divisors of a prime number pp are 11 and pp. It is known that there are infinitely many prime numbers.

The first prime numbers are:

2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,…2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, \ldots

We shall need the following theorem, also known as the fundamental theorem of arithmetic.

Theorem 1 Every natural number n≥2n \ge2 can be expressed as a product of prime numbers. Apart from the order of the factors, this representation is unique: nn has exactly one prime factorization.

For example, we can write 60=22⋅3⋅560 = 2^2 \cdot3 \cdot5. In general, every natural number n≥2n \ge2 can be written as n=p1k1p2k2⋯pjkjn = p_1^{k_1} p_2^{k_2} \cdots p_j^{k_j}, where the pip_i are distinct primes and ki∈Nk_i \in\mathbb{N}.

At first sight, the primes seem completely disordered. Sometimes they lie close together; at other times there are larger gaps. For example, one can find very large twin primes, that is, pairs of primes whose difference is 2. Whether there are infinitely many twin primes is still an open question. On the other hand, one can find arbitrarily long sequences of consecutive natural numbers, none of which is prime: The numbers n!+2n! + 2, n!+3n! + 3, …\ldots, n!+nn! + n are all nonprime for n≥2n \ge2 because n!+kn! + k is divisible by kk.

Here is a Julia program for finding twin primes (further information on the Julia programming language can be found in [8]).

# Simple primality test
function isprime(n::Int)
    if n < 2  return false end
    if n % 2 == 0  return n == 2 end
    limit = floor(Int, sqrt(n))
    for i in 3:2:limit
        if n % i == 0 return false end
    end
    return true
end

# Next pair of twin primes greater than n
function next_twin_prime(n::Int)
    p = max(n+1, 2)
    # Make p odd.
    if p % 2 == 0 p += 1 end
    while true
        if isprime(p) && isprime(p+2)
            return (p, p+2)
        end
        p += 2
    end
end

The program is self-explanatory. Call it with any natural number, and it returns the next pair of twin primes above that number.

julia> next_twin_prime(3123425343452376402)
(3123425343452376749, 3123425343452376751)

It therefore seems as though the primes have no structure. Tables can give us an impression of their distribution. Let Π(n,m)\Pi(n,m) denote the number of primes between nn and mm.

n−mn-mΠ(n,m)\Pi(n,m)
0 – 1000009592
100000 – 2000008392
200000 – 3000008013
300000 – 4000007863
400000 – 5000007678
500000 – 6000007560
600000 – 7000007445
700000 – 8000007408
800000 – 9000007323
900000 – 10000007224

Table 2.

This suggests that there may be some underlying structure after all. The average density decreases in the long run. How exactly does it decrease?

In 1792, at the age of fifteen, Carl Friedrich Gauss studied tables of primes, which could then be purchased as booklets, to understand these distributions. He formulated a conjecture that was proved only a hundred years later by Hadamard and, independently, by de la Vallée Poussin. This conjecture became known as the “prime number theorem.” In what follows, let π(n)\pi(n) denote the number of primes less than or equal to nn. For example, π(5)=π(6)=3\pi(5) = \pi(6) = 3, since there are three primes less than or equal to either 5 or 6.

The following Julia program, prime_pi(x), computes the function π(x)\pi(x). It uses the function pi_tabelle(N), which applies the sieve of Eratosthenes to build a table of prime counts up to a given number NN.

function pi_tabelle(N::Integer)
    is_prime = trues(N)
    is_prime[1] = false  # 1 is not prime.

    for p in 2:isqrt(N)
        if is_prime[p]
            for multiple in (p * p):p:N
                is_prime[multiple] = false
            end
        end
    end

    return cumsum(vcat(0, Int.(is_prime)))
end
"""Number of primes less than or equal to a real number x."""
function prime_pi(x::Real)
    x < 2 && return 0
    return pi_tabelle(floor(Int, x))[end]
end

The central line of the sieve is

for multiple in (p * p):p:N  is_prime[multiple] = false

Starting at p⋅pp \cdot p and continuing up to NN, every ppth entry is crossed out, that is, set to false in is_prime.

Plotting the graph of π(x)\pi(x) gives Figure 1. The regularity of the curve is astonishing. There must be some structure behind it.

The prime-counting function

Figure 1. The prime-counting function π(x)\pi(x) for 0≤x≤500000 \le x \le50000.

The following table lists the values of x/π(x)x/\pi(x). We observe that, for larger values of xx, they increase by about 2.3 from one power of ten to the next.

We have ln⁡(10)≈2.3\ln(10) \approx2.3, where ln⁡x\ln x denotes the natural logarithm of xx. This suggests:

10nπ(10n)≈n⋅ln⁡(10)=ln⁡(10n).\frac{10^n}{\pi(10^n)} \approx n \cdot\ln(10) = \ln(10^n).

If this holds for 10n10^n, perhaps it holds more generally: x/π(x)≈ln⁡(x)x/\pi(x) \approx\ln(x), and hence π(x)≈x/ln⁡(x)\pi(x) \approx x/\ln(x). This was Gauss’s discovery.

Theorem 2 Prime Number Theorem. As xx increases, π(x)\pi(x) approaches the function ff given by f(x):=xln⁡xf(x) := \frac{x}{\ln x} in the following sense:

lim⁡x→∞π(x)x/ln⁡x=1.\lim_{x\to\infty} \frac{\pi(x)}{x/\ln x} = 1.

One can interpret this as follows: the “probability” that a randomly chosen number nn is prime is approximately

1ln⁡(n)≈12.3⋅number of digits.\frac{1}{\ln(n)} \approx\frac{1}{2.3\cdot\text{number of digits}}.

The relative frequency of primes among all numbers up to xx, namely π(x)/x\pi(x)/x, is therefore approximately 1/ln⁡(x)1/\ln(x). This leads to another good approximation to π(x)\pi(x), first proposed by Gauss. The idea is to assign each number a weight corresponding to the approximate density of primes in its neighborhood.

First, we can write the prime-counting function exactly as a sum. For natural numbers x≥2x \ge2,

π(x)=∑n=2xan,an={1,if n is prime,0,otherwise.(1)\pi(x) = \sum_{n=2}^{x} a_n, \qquad a_n = \begin{cases} 1, & \text{if } n \text{ is prime},\\ 0, & \text{otherwise}. \end{cases} \tag*{(1)}

The individual values ana_n jump irregularly between 0 and 1. Gauss’s idea is to replace these irregular contributions by smooth average contributions. His heuristic is:

Near a large number nn, approximately a proportion 1/ln⁡n1/\ln n of the numbers are prime.

For example,

1ln⁡1000≈0.145.\frac{1}{\ln1000} \approx0.145.

Intuitively, this means that in a suitable range near 1000, we expect about 14.5 % of the numbers to be prime. For a fixed number, of course, whether it is prime is completely determined; the “probability” here describes an average frequency.

We therefore approximately replace the contribution ana_n in (1) by 1/ln⁡n1/\ln n. Adding these weights gives

π(x)≈1ln⁡2+1ln⁡3+⋯+1ln⁡x.\pi(x) \approx\frac{1}{\ln2}+\frac{1}{\ln3}+\cdots+\frac{1}{\ln x}.

This takes into account the fact that prime density decreases as nn increases: smaller numbers receive larger weights, and larger numbers receive smaller weights. The simpler approximation x/ln⁡xx/\ln x uses the same value 1/ln⁡x1/\ln x throughout the whole range. The sum can in turn be approximated by the area under the graph of u↦1/ln⁡uu \mapsto1/\ln u:

∑n=2x1ln⁡n≈∫2xduln⁡u.\sum_{n=2}^{x}\frac{1}{\ln n}\approx\int_{2}^{x}\frac{\mathrm{d}u}{\ln u}.

We therefore expect

π(x)≈∫2xduln⁡u.\pi(x)\approx\int_{2}^{x}\frac{\mathrm{d}u}{\ln u}.

This approximation is somewhat more accurate than the one in the prime number theorem. We define

Li⁡(x)=∫2xduln⁡u.\operatorname{Li}(x)=\int_{2}^{x}\frac{\mathrm{d}u}{\ln u}.

Plotting Li⁡\operatorname{Li} and π\pi together gives Figure 2. Notice that π(x)\pi(x) always lies below

Prime counting and logarithmic integral

Figure 2. π(x)\pi(x) and Li⁡(x)\operatorname{Li}(x) for 2≤x≤100002 \le x \le10000.

Li⁡(x)\operatorname{Li}(x) (at least for x>7x > 7). This remains the case when the graph is extended to much larger values of xx. However, it has been proved that π(x)\pi(x) and Li⁡(x)\operatorname{Li}(x) exchange places infinitely often. The first such crossing occurs for x<10300x < 10^{300}. We may never find this point: 1030010^{300} is simply too large.

The following statement is equivalent to the Riemann hypothesis (be patient—we shall introduce it later):

(RH’): For sufficiently large xx, the absolute error in Gauss’s approximation Li⁡(x)\operatorname{Li}(x) to π(x)\pi(x) is at most a constant multiple of x⋅ln⁡x\sqrt{x}\cdot\ln x, that is,

∣π(x)−Li⁡(x)∣≤Cxln⁡x.\lvert\pi(x)-\operatorname{Li}(x)\rvert\le C\sqrt{x}\ln x.

This can also be made more explicit. For example, the Riemann hypothesis is equivalent to

∣π(x)−Li⁡(x)∣<18πxln⁡x,for x≥2657.\lvert\pi(x)-\operatorname{Li}(x)\rvert< \frac{1}{8\pi}\sqrt{x}\ln x,\qquad\text{for }x\ge2657.

Schoenfeld proved this as early as 1976. This remains an active area of research.

A Formula of Euler

Let 1≠qs1\ne q^{s}. It is easy to prove the formula

1−q(n+1)s1−qs=1+qs+q2s+q3s+⋯+qns.(2)\frac{1-q^{(n+1)s}}{1-q^{s}}=1+q^{s}+q^{2s}+q^{3s}+\cdots+q^{ns}. \tag*{(2)}

Expand (1−ps)⋅(1+ps+p2s+p3s+⋯+pns)(1-p^{s})\cdot(1+p^{s}+p^{2s}+p^{3s}+\cdots+p^{ns}) by hand and show that all terms cancel except 11 and −p(n+1)s-p^{(n+1)s}.

Lemma 3 For p∈Np\in\mathbb{N}, p>1p>1, and s>1s>1, we have

∑i=0∞1(ps)i=11−1ps.\sum_{i=0}^{\infty}\frac{1}{(p^{s})^{i}}=\frac{1}{1-\frac{1}{p^{s}}}.

Proof. Substitute q=1/pq=1/p into formula (2):

∑i=0n1(ps)i=1−1p(n+1)s1−1ps.\sum_{i=0}^{n}\frac{1}{(p^{s})^{i}}=\frac{1-\frac{1}{p^{(n+1)s}}}{1-\frac{1}{p^{s}}}.

As nn tends to infinity, 1p(n+1)s\frac{1}{p^{(n+1)s}} tends to 00 (since p>1p>1), giving the claimed formula. □

Let P\mathcal{P} be the set of prime numbers. Euler considered the product

∏p∈P11−1ps=11−12s⋅11−13s⋅11−15s⋯\prod_{p\in\mathcal{P}}\frac{1}{1-\frac{1}{p^{s}}} =\frac{1}{1-\frac{1}{2^{s}}}\cdot\frac{1}{1-\frac{1}{3^{s}}}\cdot\frac{1}{1-\frac{1}{5^{s}}}\cdots

By Lemma 3, we can rewrite this as

∏p∈P11−1ps=∏p∈P∑i=0∞1(ps)i.\prod_{p\in\mathcal{P}} \frac{1}{1-\frac{1}{p^s}}=\prod_{p\in\mathcal{P}}\sum_{i=0}^{\infty}\frac{1}{(p^s)^i}.

We obtain

∏p∈P11−1ps=∏p∈P∑i=0∞1(ps)i=(1+12s+122s+123s+124s+⋯ )⋅(1+13s+132s+133s+134s+⋯ )⋅(1+15s+152s+153s+154s+⋯ )⋅(1+17s+172s+173s+174s+⋯ )⋅⋯ .\begin{aligned} \prod_{p\in\mathcal{P}}\frac{1}{1-\frac{1}{p^s}} &=\prod_{p\in\mathcal{P}}\sum_{i=0}^{\infty}\frac{1}{(p^s)^i}\\ &=\left(1+\frac{1}{2^s}+\frac{1}{2^{2s}}+\frac{1}{2^{3s}}+\frac{1}{2^{4s}}+\cdots\right)\\ &\mathbin{\cdot}\left(1+\frac{1}{3^s}+\frac{1}{3^{2s}}+\frac{1}{3^{3s}}+\frac{1}{3^{4s}}+\cdots\right)\\ &\mathbin{\cdot}\left(1+\frac{1}{5^s}+\frac{1}{5^{2s}}+\frac{1}{5^{3s}}+\frac{1}{5^{4s}}+\cdots\right)\\ &\mathbin{\cdot}\left(1+\frac{1}{7^s}+\frac{1}{7^{2s}}+\frac{1}{7^{3s}}+\frac{1}{7^{4s}}+\cdots\right)\\ &\mathbin{\cdot}\cdots. \end{aligned}

In this product, the nonzero contributions are obtained by choosing a value different from 1 from only finitely many factors. Each such term has the form

1p1sk1p2sk2⋯pjskj=(1p1k1p2k2⋯pjkj)s,\frac{1}{p_1^{s k_1}p_2^{s k_2}\cdots p_j^{s k_j}}=\left(\frac{1}{p_1^{k_1}p_2^{k_2}\cdots p_j^{k_j}}\right)^s,

where the pip_i are distinct primes and ki∈Nk_i\in\mathbb{N}. Moreover, each possible term occurs exactly once. Recall Theorem 1, the theorem on unique prime factorization. The denominator on the right is the prime factorization of a natural number. Every natural number appears exactly once as a denominator. Thus we obtain the following formula, which Euler discovered in the eighteenth century:

∏p∈P11−1ps=∑n=1∞1ns.(3)\prod_{p\in\mathcal{P}}\frac{1}{1-\frac{1}{p^s}}=\sum_{n=1}^{\infty}\frac{1}{n^s}. \tag*{(3)}

This formula is another marvel. On the left is a product involving only primes. On the right, we sum over all natural numbers. At first sight, the expression on the right has nothing to do with primes at all! Yet somehow all the primes must be hidden in that sum. This must have caught Riemann’s attention.

The Riemann Zeta Function

Formula (3) defines a function of ss. The function

ζ(s)=∑n=1∞1ns\zeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s}

is called the Riemann zeta function. It is defined only for s>1s>1. For s=1s=1, we would have

ζ(1)=∑n=1∞1n,\zeta(1)=\sum_{n=1}^{\infty}\frac{1}{n},

and here the following result applies:

Theorem 4 The series ∑n=1∞1n\sum_{n=1}^{\infty}\frac{1}{n} diverges.

Proof: We group the terms into blocks:

1+12+(13+14)+(15+⋯+18)+(19+⋯+116)+⋯ .1+\frac{1}{2}+\left(\frac{1}{3}+\frac{1}{4}\right)+\left(\frac{1}{5}+\cdots+\frac{1}{8}\right)+\left(\frac{1}{9}+\cdots+\frac{1}{16}\right)+\cdots.

The block

∑n=2k−1+12k1n\sum_{n=2^{k-1}+1}^{2^k}\frac{1}{n}

contains 2k−12^{k-1} terms. Each is at least 1/2k1/2^k. Therefore,

∑n=2k−1+12k1n≥2k−12k=12.\sum_{n=2^{k-1}+1}^{2^k}\frac{1}{n}\ge\frac{2^{k-1}}{2^k}=\frac{1}{2}.

Hence the partial sums satisfy

∑n=12m1n≥1+m2→m→∞∞.\sum_{n=1}^{2^m}\frac{1}{n}\ge1+\frac{m}{2}\xrightarrow[m\to\infty]{}\infty.

Since all terms are positive, the partial sums increase monotonically. Thus

∑n=1∞1n=∞.\sum_{n=1}^{\infty}\frac{1}{n}=\infty.

□

Incidentally, this gives us a second proof that there are infinitely many primes. If there were only finitely many, the product on the left of formula (3) would be a finite number, whereas the right-hand side is infinite by the theorem just proved. This is a contradiction.

In 1859, Riemann wrote a groundbreaking paper [7]. His idea was to extend the function ζ(s)\zeta(s) to complex numbers (the necessary background on complex numbers can be found, for example, in [4]). This makes ζ(s)\zeta(s) a function defined for all complex numbers ss whose real part is greater than 1. We now have natural numbers raised to complex powers. How should we think about this?

Let n≥1n \ge1 be a natural number and let

s=σ+it,σ>1.s = \sigma+ it, \qquad\sigma> 1.

We define ns:=esln⁡nn^s := e^{s \ln n}. Euler’s formula (i.e. eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta+ i \sin\theta for θ∈R\theta\in\mathbb{R}) gives

nσ+it=nσ(cos⁡(tln⁡n)+isin⁡(tln⁡n)).n^{\sigma+it} = n^\sigma\left(\cos(t \ln n) + i \sin(t \ln n)\right).

Thus the modulus is nσn^\sigma, while the angle is tln⁡nt \ln n. For example, 22+i=4(cos⁡(ln⁡2)+isin⁡(ln⁡2))2^{2+i} = 4\left(\cos(\ln2) + i \sin(\ln2)\right). For the reciprocal, we similarly have

1ns=n−σ(cos⁡(tln⁡n)−isin⁡(tln⁡n)),∣1ns∣=1nσ.\frac{1}{n^s} = n^{-\sigma}\left(\cos(t \ln n) - i \sin(t \ln n)\right), \qquad\left|\frac{1}{n^s}\right| = \frac{1}{n^\sigma}.

These powers are defined for every complex exponent. The condition σ>1\sigma> 1 additionally guarantees that the series

∑n=1∞1ns\sum_{n=1}^{\infty} \frac{1}{n^s}

converges absolutely, since

∑n=1∞∣1ns∣=∑n=1∞1nσ<∞.\sum_{n=1}^{\infty}\left|\frac{1}{n^s}\right| = \sum_{n=1}^{\infty}\frac{1}{n^\sigma} < \infty.

Let us look at a concrete example. Consider

ζ(2+i)=112+i+122+i+132+i+142+i+⋯=1+1412i+1913i+11614i+⋯\begin{aligned} \zeta(2+i)=\frac{1}{1^{2+i}}+\frac{1}{2^{2+i}}+\frac{1}{3^{2+i}}+\frac{1}{4^{2+i}}+\cdots\\ &=1+\frac{1}{4}\frac{1}{2^i}+\frac{1}{9}\frac{1}{3^i}+\frac{1}{16}\frac{1}{4^i}+\cdots \end{aligned}

Figure 3 shows an approximation to this function value in the complex plane. Taking only the first term would bring us to 1, as indicated by the arrow from 0 to 1. Adding the second term brings us to the tip of the second arrow. We have turned through −39.7∘-39.7^\circ, due to the factor 1/2i1/2^i, and traveled a distance of 1/41/4. The other two terms are handled in the same way. The point S4S_4 represents the function value obtained from the first four terms.

An approximation to $\zeta(2+i)$

Figure 3. An approximation to ζ(2+i)\zeta(2+i).

To summarize, we have a function ζ(s)=∑n=1∞1ns\zeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s} whose domain consists of the complex numbers with real part greater than 1. It is known—and Riemann already knew this—that ζ(s)\zeta(s) has a unique holomorphic continuation (that is, a continuation that is complex differentiable everywhere) to the entire complex plane except for a simple pole at s=1s=1.

Figure 4 shows the modulus of the zeta function extended to C∖{1}\mathbb{C}\setminus\{1\}. The pole is at 1, and we can see how the modulus grows in its neighborhood. Hasse’s series provides a formula for computing the zeta function throughout C∖{1}\mathbb{C}\setminus\{1\}:

The modulus of the zeta function over the complex plane

Figure 4. The modulus of the zeta function, with the pole at 1 excluded.

ζ(s)=1s−1∑n=0∞1n+1∑k=0n(−1)k(nk)(k+1)1−s,s∈C∖{1}.\zeta(s)=\frac{1}{s-1}\sum_{n=0}^{\infty}\frac{1}{n+1}\sum_{k=0}^{n}(-1)^k\binom{n}{k}(k+1)^{1-s},\qquad s\in\mathbb{C}\setminus\{1\}.

Let us experiment with Julia. The zeta function is implemented in Julia as zeta(s). It belongs to the SpecialFunctions package and accepts both real and complex arguments.

Install the package once in Julia:

import Pkg; Pkg.add("SpecialFunctions")

Then load it using

using SpecialFunctions

You can now compute function values:

zeta(2)        # Approximately 1.6449340668482264
zeta(0)        # -0.5
zeta(-1)       # Approximately -0.083333333333333333
zeta(-2)       # 0.0

In Julia, im denotes the imaginary unit ii.

s = 0.5 + 14.1im
w = zeta(s)

println("Function value: ", w)
println("Real part:      ", real(w))
println("Imaginary part: ", imag(w))
println("Modulus:        ", abs(w))

The Riemann Hypothesis

Consider the unique holomorphic continuation to C∖{1}\mathbb{C} \setminus\{1\} of the function initially defined by ∑n≥1n−s\sum_{n\geq1} n^{-s} for Re⁡s>1\operatorname{Re} s > 1. We continue to denote it by ζ\zeta. The ζ\zeta-function has no zeros with real part greater than 1. This can be seen from the fact that ζ(s)=∑n=1∞1ns\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} is nonzero for real numbers s>1s > 1. One can prove that the negative even integers, that is, −2,−4,−6,…-2, -4, -6, \ldots, are zeros of ζ\zeta. They are called the trivial zeros. There are also nontrivial zeros; indeed, it is known that there are infinitely many of them. An online database contains more than 10310^3 billion nontrivial zeros of the zeta function. All these zeros have real part 1/21/2.

In Table 1 are the first ten nontrivial zeros (Re denotes the real part and Im the imaginary part of a complex number). For every nontrivial zero, its complex conjugate, with the opposite imaginary part, is also a zero. For example, 1/2−14.1347251417i1/2 - 14.1347251417i is also a zero.

xxπ(x)\pi(x)x/π(x)x/\pi(x)
1042.5
100254.0
10001686.0
1000012298.1
100000959210.4
10000007849812.7
1000000066457915.0
100000000576145517.4
10000000005084753419.7
1000000000045505251122.0

Table 1.

We can now state the Riemann hypothesis:

(RH): All nontrivial zeros of the Riemann zeta function have real part 1/21/2.

In the first section, we encountered conjecture (RH′), a statement about primes. Conjecture (RH) is an equivalent statement in analysis. The zeta function translates arithmetic statements about primes into analytic properties of functions. The connection is astonishing. In modern mathematics, one often tries to reformulate conjectures from one field in another in order to obtain a different approach, as in the Langlands program—but that is another story.

nnRe⁡(ρn)\operatorname{Re}(\rho_n)Im⁡(ρn)\operatorname{Im}(\rho_n)
11/21/214.1347251417
21/21/221.0220396388
31/21/225.0108575801
41/21/230.4248761259
51/21/232.9350615877
61/21/237.5861781588
71/21/240.9187190121
81/21/243.3270732809
91/21/248.0051508812
101/21/249.7738324777

Table 1 (PDF p. 13). The first ten nontrivial zeros ρn=12+iγn\rho_n = \frac{1}{2} + i\gamma_n of the Riemann zeta function with positive imaginary part. The imaginary parts are rounded to ten decimal places.

The line x=1/2x = 1/2 in the complex plane is called the critical line. The Riemann hypothesis can therefore also be stated as follows:

All nontrivial zeros of the Riemann zeta function lie on the critical line.

It is known that all nontrivial zeros lie in the critical strip, that is, 0<Re⁡s<10 < \operatorname{Re} s < 1 for every nontrivial zero ss (these bounds have recently been slightly improved). Figure 5 shows part of the complex plane with the first trivial

The complex plane with trivial and nontrivial zeros, the critical line, and the critical strip

Figure 5. The complex plane.

and nontrivial zeros.

Figure 6 shows a segment of the critical line and its image under ζ\zeta. We can see the image curve repeatedly passing through 0. The Riemann hypothesis has many consequences, for example for primality tests, elliptic curves, endomorphism rings, and much more. In his paper [7], Riemann himself developed an analytic formula for π(x)\pi(x). In the next section, we turn to another application.

The segment $s = 1/2 + it$, $0 \le t \le 50$, in the domain and its image under $\zeta$

Figure 6. The segment s=1/2+its = 1/2 + it, 0≤t≤500 \le t \le50, in the domain and its image under ζ\zeta.

Wave Functions

Let γi\gamma_i be the imaginary parts of the nontrivial zeros of the zeta function in the upper half-plane, arranged in increasing order. Thus γ1=14.1347251417\gamma_1 = 14.1347251417, γ2=21.0220396388\gamma_2 = 21.0220396388, and so on. Consider the functions fi(x)=cos⁡(γi⋅ln⁡(x))f_i(x) = \cos(\gamma_i \cdot\ln(x)). Figure 7 shows the function f1(x)=cos⁡(γ1⋅ln⁡(x))=cos⁡(14.1347251417⋅ln⁡(x))f_1(x) = \cos(\gamma_1 \cdot\ln(x)) = \cos(14.1347251417 \cdot\ln(x)).

The function $f_1(x) = \cos(\gamma_1 \cdot \ln(x))$

Figure 7. The function f1(x)=cos⁡(γ1⋅ln⁡(x))f_1(x) = \cos(\gamma_1 \cdot\ln(x)).

Figure 8 shows the function f2(x)=cos⁡(γ2⋅ln⁡(x))=cos⁡(21.0220396388⋅ln⁡(x))f_2(x) = \cos(\gamma_2 \cdot\ln(x)) = \cos(21.0220396388 \cdot\ln(x)). It is very similar to f1f_1, but somewhat compressed horizontally. We can superimpose these wave functions by adding them:

Plot of the function $f_2(x)=\cos(\gamma_2\ln(x))$

Figure 8. The function f2(x)=cos⁡(γ2⋅ln⁡(x))f_2(x)=\cos(\gamma_2\cdot\ln(x)).

ω(x)=∑i=1200fi(x)=f1(x)+f2(x)+…+f200(x).\omega(x)=\sum_{i=1}^{200} f_i(x)=f_1(x)+f_2(x)+\ldots+f_{200}(x).

The resulting function ω(x)\omega(x) is plotted in Figure 9. There are pronounced

Plot of $f_1(x)+f_2(x)+\ldots+f_{200}(x)$

Figure 9. f1(x)+f2(x)+…+f200(x)f_1(x)+f_2(x)+\ldots+f_{200}(x).

downward spikes very close to the primes. We put the nontrivial zeros of the zeta function into ω\omega, and out came the primes! Another marvel!

There are also somewhat smaller spikes at prime powers, namely 4, 8, 9, 16, 25, 27, and 32.

The zeros of the zeta function know everything about primes. This also works in reverse: the primes know the zeros of the zeta function. To see this, consider the function

gi(x)=cos⁡(x⋅ln⁡(pi))pi,g_i(x)=\frac{\cos(x\cdot\ln(p_i))}{\sqrt{p_i}},

where pip_i is the ith prime. Again, we add these functions:

κ(x)=∑i=11000gi(x)=cos⁡(x⋅ln⁡(2))2+cos⁡(x⋅ln⁡(3))3+cos⁡(x⋅ln⁡(5))5+…+cos⁡(x⋅ln⁡(7919))7919.\kappa(x)=\sum_{i=1}^{1000}g_i(x)=\frac{\cos(x\cdot\ln(2))}{\sqrt{2}}+\frac{\cos(x\cdot\ln(3))}{\sqrt{3}}+\frac{\cos(x\cdot\ln(5))}{\sqrt{5}}+\ldots+\frac{\cos(x\cdot\ln(7919))}{\sqrt{7919}}.

Figure 10 shows the function κ(x)\kappa(x). The spikes lie very close to the imaginary

The function $\kappa(x)$

Figure 10. The function κ(x)\kappa(x).

parts of the nontrivial zeros of the zeta function. They do not occur at exactly those values because we have used only a finite sum for κ\kappa. A more precise mathematical treatment would show that we are investigating the zeros along the critical line.

The secret of the primes: they can be read off from the zeros of an analytic function.

The Divisor-Sum Conjecture

We define

σ(n)=∑d∣nd\sigma(n) = \sum_{d\mid n} d

Thus σ(n)\sigma(n) is the sum of all positive divisors of nn. For example,

σ(10)=1+2+5+10=18.\sigma(10) = 1 + 2 + 5 + 10 = 18.

It is known (and the proof is not difficult) that σ\sigma is multiplicative: if m,nm,n are coprime natural numbers, then σ(mn)=σ(m)σ(n)\sigma(mn)=\sigma(m)\sigma(n). Thus, given the prime factorization n=p1k1p2k2…pjkjn=p_1^{k_1}p_2^{k_2}\ldots p_j^{k_j}, we have

σ(n)=σ(p1k1)σ(p2k2)…σ(pjkj).\sigma(n) = \sigma(p_1^{k_1})\sigma(p_2^{k_2})\ldots\sigma(p_j^{k_j}).

It is easy to see that if pp is prime, then σ(p)=p+1\sigma(p)=p+1 and σ(pn)=1+p+p2+…+pn\sigma(p^n)=1+p+p^2+\ldots+p^n. Together with Formula (2) we have

σ(n)=∏i=1j1−piki+11−pi.\sigma(n) = \prod_{i=1}^{j} \frac{1-p_i^{k_i+1}}{1-p_i}.

However, this formula allows us to compute σ(n)\sigma(n) only when we know the prime factorization of nn.

We also need the function

h(n)=∑i=1n1i.h(n) = \sum_{i=1}^{n} \frac{1}{i}.

These are partial sums of the series considered in Theorem 4. The value h(n)h(n) is called the nnth harmonic number. In Julia, the command cumsum(1.0 ./ (1:n)) gives us h(n)h(n). First, 1.0 ./ (1:n) produces the reciprocals 1,12,…,1n1, \frac{1}{2}, \ldots, \frac{1}{n}, and cumsum adds them cumulatively.

The divisor-sum conjecture states:

(DS): For every natural number nn, the following inequality holds:

σ(n)≤h(n)+eh(n)ln⁡(h(n)).\sigma(n) \le h(n) + e^{h(n)} \ln(h(n)).

This conjecture can be formulated in entirely elementary terms. In 2000, Lagarias surprisingly proved that it is equivalent to the Riemann hypothesis (see [2]). Using Julia, we can plot the function

d(n)=h(n)+eh(n)ln⁡(h(n))−σ(n).d(n) = h(n) + e^{h(n)} \ln(h(n)) - \sigma(n).

Figure 11 shows d(n)d(n). All values in this range are positive, as expected. We can see how unevenly the values are distributed. They all appear to lie below a straight line.

Plot of the divisor-sum conjecture

Figure 11. The divisor-sum conjecture.

Hardy's Function

To conclude, let us experiment with Julia once more. Hardy’s ZZ-function (see [5]) is a function Z:R→RZ:\mathbb{R}\to\mathbb{R} whose zeros are exactly the imaginary parts of the nontrivial zeros of the zeta function that lie on the critical line (these are all the nontrivial zeros if the Riemann hypothesis holds). We have

Z(t)=0⟺ζ(12+it)=0.Z(t)=0\quad\Longleftrightarrow\quad\zeta\left(\frac{1}{2}+it\right)=0.

We cannot simply use ζ(1/2+ti)\zeta(1/2+ti) as our real-valued function, because away from its zeros it takes complex values. The ZZ-function is defined by

Z(t)=eiθ(t)ζ(12+it),t∈R,Z(t)=e^{i\theta(t)}\zeta\left(\frac{1}{2}+it\right),\qquad t\in\mathbb{R},

where

θ(t)=Im⁡log⁡Γ(14+it2)−t2ln⁡π\theta(t)=\operatorname{Im}\log\Gamma\left(\frac{1}{4}+\frac{it}{2}\right)-\frac{t}{2}\ln\pi

is the Riemann–Siegel theta function. Here log denotes the complex natural logarithm, and Γ\Gamma is the gamma function. I shall not go into the details here. What matters is that the factor eiθ(t)e^{i\theta(t)} represents a rotation (its modulus is 1) that rotates the complex function values onto the real axis, so that the resulting function takes only real values.

The following program implements the ZZ-function in Julia:

using SpecialFunctions

# Riemann-Siegel theta function
function theta(x::Real)
    return imag(loggamma(0.25 + 0.5im * x)) - (x / 2) * log(pi)
end

# Hardy’s Z-function
function Z(x::Real)
    return real(exp(im * theta(x)) * zeta(0.5 + im * x))
end

In Figure 12, we have plotted part of the graph of the ZZ-function using the program above. We can see that its zeros correspond exactly to the first nontrivial zeros of the zeta function. The absolute values of the other function values agree exactly with the modulus of ζ(1/2+xi)\zeta(1/2+xi). In this sense, the ZZ-function visualizes the zeta function on the critical line. Looking at several plots over different ranges of the xx-axis reveals how chaotic the function’s behavior is.

The Z-function from 0 to 50

Figure 12. The ZZ-function from 0 to 50.

AI was used in this article to generate some of the illustrations, to create the Julia programs and the bibliography, and to proofread the text.

Stephan Rosebrock Department of Mathematics Karlsruhe University of Education Bismarckstr. 10 76133 Karlsruhe, Germany Email: [email protected]

References

  1. [2]Jeffrey C. Lagarias; An Elementary Problem Equivalent to the Riemann Hypothesis; The American Mathematical Monthly 109, no. 6, pp. 534–543, 2002. https://arxiv.org/abs/math/0008177
  2. [4]Tristan Needham; Visual Complex Analysis; Oxford University Press, Oxford, 1997.
  3. [5]Aleksandar Ivić; Hardy’s Function Z(t)—Results and Problems; arXiv:1601.06512, 2016. https://arxiv.org/abs/1601.06512
  4. [7]Bernhard Riemann; On the Number of Prime Numbers Less Than a Given Quantity; 1859. English translation by David R. Wilkins, 1998. https://www.claymath.org/wp-content/uploads/2023/04/Wilkins-translation.pdf
  5. [8]The Julia Project; Julia Documentation. https://docs.julialang.org/en/v1/ Accessed November 13, 2026.DOI

Paper details

vlnc:W_w7xhvr2q
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 4

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents