Hechi's Blog

↑ Analytic Number Theory

Dirichlet Series

  1. Motivation
  2. Arithmetic Functions and Dirichlet Series
  3. Perron's Formula
  4. Contour Shifting
  5. References

Motivation

Given a positive integer nn, what is the number of its divisors? This problem appears constantly in coding challenges. Write this number of divisors into a condense form

d(n)≔∑d∣n1,n∈Z+ d(n) \coloneqq \sum_{d \mid n} 1, \quad n \in \mathbb Z_+

and let us also define this as a function in Julia with Primes.jl and plot the first values with CairoMakie.jl

Seems quite random, however in this article we will discuss the following striking asymptoticity obtained by Dirichlet in 1849

∑n≤xd(n)∼xlog⁡x+(2γ−1)x,x→+∞ \sum_{n \leq x} d(n) \sim x \log x + (2\gamma - 1) x, \quad x \to +\infty

as plotted

As shown above, the asymptotic formula is already evident for n≤100n \leq 100.

The correct way to study ∑n≤xd(n)\sum_{n \leq x}d(n) is through its Dirichlet series L(s,d)≔∑n>0d(n)/nsL(s, d) \coloneqq \sum_{n > 0} d(n)/n^s. I will present two reasons to introduce Dirichlet series: they capture the algebraic structure behind d(n)d(n), and their poles and zeros reflects the behavior of ∑n≤xd(n)\sum_{n \leq x} d(n) as x→+∞x \to +\infty. This topic will motivate the study of analytic number theory.

Arithmetic Functions and Dirichlet Series

Let us extract the obvious information from the definition d(n)=∑d∣n1d(n) = \sum_{d \mid n} 1: it is a function defined on Z+\mathbb Z_+, and the sum is over divisors. This abstracts into the following definition.

Definition. The commutative ring of arithmetic functions is the set of functions

A≔{f:Z+→C} \mathcal A \coloneqq \{f: \mathbb Z_+ \to \mathbb C\}

equipped with pointwise addition and multiplication given by convolution

f∗g(n)≔∑d∣nf(d)g(n/d). f * g(n) \coloneqq \sum_{d \mid n} f(d) g(n/d).

The function

δ(n)={1,n=1,0,n>1. \delta(n) = \left\{ \begin{array}{ll} 1, & n = 1, \\ 0, & n > 1. \end{array} \right.

serves as unity.

For every arithmetic function a(n)a(n) there is an associated Dirichlet series ∑n>0a(n)/ns\sum_{n > 0}a(n)/n^s. For now just ignore the convergence issue and consider this as a foraml series. The ring of formall Dirichlet series is nothing but C⟦Z+⟧\mathbb C \llbracket \Z_+ \rrbracket, the complete monoid algebra of the multiplicative monoid (Z+,×)(\Z_+, \times). Our association defines a ring isomorphism

A≅C⟦Z+⟧,a↦L(s,a)≔∑n>0a(n)ns \mathcal A \cong \mathbb C \llbracket \Z_+ \rrbracket, \quad a \mapsto L(s, a) \coloneqq \sum_{n > 0} \frac{a(n)}{n^s}

this would be clear once we notice that for the function

δm(n)=δ(n−m) \delta_m(n) = \delta(n - m)

there is

δl∗δm=δlm. \delta_l * \delta_m = \delta_{lm}.

Remark. Mapping 1/ps1/p^s to xpx_p for each prime pp gives an isomorphism

C⟦Z+⟧≅C⟦z2,z3,z5,z7,…⟧\mathbb C \llbracket \Z_+ \rrbracket \cong \mathbb C \llbracket z_2, z_3, z_5, z_7, \dots \rrbracket

where the right-hand side is the formal power series ring of independent variables indexed by prime numbers.

Now consider the constant function 1(n)=1\mathbf{1}(n) = 1, we immediately check that d=1∗1d = \mathbf{1} * \mathbf{1}, which means L(s,d)=L(s,1)2L(s, d) = L(s, \mathbf{1})^2. This L(s,1)L(s, \mathbf{1}) is better known as the Riemann ζ\zeta function, the central object of analytic number theory. We will study the very basics of ζ(s)\zeta(s), then ζ(s)2\zeta(s)^2 comes for free. But that will not be helpful unless we understand how L(s,a)L(s, a) can be used to study ∑n≤xa(n)\sum_{n \leq x} a(n).

Perron's Formula

If the Dirichlet series L(s,a)=∑n>0a(n)n−sL(s, a) = \sum_{n > 0} a(n)n^{-s} converges absolutely at some s∈Cs \in \mathbb C, then convergence is guaranteed at every point to the right of ss. If we define

σa≔inf⁡{ℜs∣∑n>0a(n)n−s converges absolutely} \sigma_a \coloneqq \inf \{\Re s \mid \text{$\sum_{n > 0} a(n) n^{-s}$ converges absolutely}\}

the Dirichlet series will converge as long as ℜs>σa\Re s > \sigma_a.

Assume ℜs>σa\Re s > \sigma_a and apply Abel's summation formula, we have

∑n>0a(n)ns=s∫1+∞A(x)x−s−1dx \sum_{n > 0} \frac{a(n)}{n^s} = s \int_1^{+\infty} A(x) x^{-s - 1} \mathrm d x

where A(x)=∑n≤xa(x)A(x) = \sum_{n \leq x} a(x). Absolute convergence is necessary since we need to interchange summation and integral.

After a change of variable x=etx = \mathrm e^t, we see that L(s,a)/sL(s, a)/s is the Laplace transform of A(et)A(\mathrm e^t):

L(s,a)s=∫0+∞A(et)e−stdt. \frac{L(s, a)}{s} = \int_0^{+\infty} A(\mathrm e^t) \mathrm e^{-st} \mathrm d t.

Apply the inverse Laplace transform and we get

A(x−)+A(x+)2=12πi∫c−i∞c+i∞L(s,a)xssds. \frac{A(x^-) + A(x^+)}{2} = \frac{1}{2\pi \mathrm i}\int_{c - i \infty}^{c + i\infty} L(s, a) \frac{x^s}{s} \mathrm d s.

where cc is any real number larger than σa\sigma_a. The left-hand side is often written as ∑n≤x′a(n)\sum'_{n \leq x} a(n), the only difference from the usual ∑\sum is that when xx is an integer, the last term a(x)a(x) is replaced by a(x)/2a(x)/2. The above equality is called Perron's formula.

Contour Shifting

The Perron formula is exact, but it gives no information unless we can find the dominant terms. The idea is to shift the integral contour left to get a smaller integral, while the singularities crossed should contribute to the dominant terms.

Take a=1a = \mathbf{1} for example, in this case A(x)=⌊x⌋∼xA(x) = \lfloor x \rfloor \sim x is obvious, so we expect to obtain the same result from Dirichlet series L(s,1)=ζ(s)L(s, \mathbf{1}) = \zeta(s). The series

11s+12s+⋯ \frac{1}{1^s} + \frac{1}{2^s} + \cdots

converges for ℜs>1\Re s > 1, and has a pole at s=1s = 1. But what is to the left of this pole? The hope is to find a meromorphic function extending ∑n>0n−s\sum_{n > 0}n^{-s} so that we can define ζ(s)\zeta(s) on the points to the left of s=1s = 1. This is called a meromorphic continuation. It turns out that ζ\zeta has a meromorphic continuation to the entired complex plane But for our purpose, we just need to extend ζ\zeta a little bit left, and the treatment is much easier.

Consider the alternating sum

D(s)=∑n>0(−1)n−1n−s=1−2−s+3−s−4−s+⋯ D(s) = \sum_{n > 0} (-1)^{n-1}n^{-s} = 1 - 2^{-s} + 3^{-s} - 4^{-s} + \cdots

which converges for ℜs>0\Re s > 0 (uniformly in compact subsets). The trick is

ζ(s)−D(s)=2∗(2−s+4−s+6−s+⋯ )=21−sζ(s) \zeta(s) - D(s) = 2 * (2^{-s} + 4^{-s} + 6^{-s} + \cdots) = 2^{1 - s} \zeta(s)

and therefore

ζ(s)=D(s)1−21−s \zeta(s) = \frac{D(s)}{1 - 2^{1-s}}

for ℜs>0\Re s > 0. The possible poles are from the zeros of 1−21−s1 - 2^{1-s}, i.e. s=1+2πilog⁡2m,m∈Zs = 1 + \frac{2 \pi \mathrm i}{\log 2}m, m \in \Z. Only s=1s = 1 is a pole and to show this we consider another function

D~(s)=1+12s−23s+14s+15s−26s+⋯=(1−31−s)ζ(s) \tilde{D}(s) = 1 + \frac{1}{2^s} - \frac{2}{3^s} + \frac{1}{4^s} + \frac{1}{5^s} - \frac{2}{6^s} + \cdots = (1 - 3^{1-s})\zeta(s)

which gives a different expression

ζ(s)=D~(s)1−31−s. \zeta(s) = \frac{\tilde D(s)}{1 - 3^{1-s}}.

Now the possible poles are of the form s=1+2πilog⁡3m,m∈Zs = 1 + \frac{2\pi \mathrm i}{\log 3}m, m \in \Z. Notice that gcd⁡(2,3)=1\gcd(2, 3) = 1, the quotient log⁡3log⁡2=log⁡23\frac{\log 3}{\log 2} = \log_2 3 cannot be a rational number, so s=1s = 1 is the only pole. We may plot the ζ\zeta function as follows, the color reflects argument, and brightness reflects absolute value. As we can see, the brightest point is the pole.

Consider the following contour, which we will shift.

References

CC BY-SA 4.0 Hechi Zhang. Last modified: October 07, 2026. Website built with Franklin.jl and the Julia programming language.