Dirichlet Convolution

Suppose you know how many divisors each integer has. Separately, you know the value of Euler's totient function at each integer. Is there a natural way to combine two arithmetic functions into a new one? The goal is to make useful identities, like ∑d∣nφ(d)=n\sum_{d\mid n}\varphi(d) = n, instances of a single algebraic operation. The Dirichlet convolution answers this question. It is a product on the set of arithmetic functions, built out of sums over divisor pairs. This product turns the collection of all such functions into a commutative ring with unit. This is not merely bookkeeping. The convolution structure is the hidden engine behind Mobius Inversion. It also lies behind the Euler product factorization of the Riemann zeta function. And it underlies nearly every identity relating τ,σ,φ,μ\tau, \sigma, \varphi, \mu, and the identity function. The central fact proved here is a preservation theorem. If ff and gg are Multiplicative Functions, then so is f∗gf * g. This single result explains why so many classical arithmetic identities look "the same" once written in convolution form. It also explains why multiplicativity — a condition about coprime arguments — survives an operation defined by summing over all divisors, coprime or not. The proof is a clean exercise in reindexing sums using the Chinese Remainder Theorem for divisor lattices. It is the template for essentially every multiplicativity argument in elementary number theory. The big picture: the set of arithmetic functions f:Z+→Cf:\mathbb{Z}^+\to\mathbb{C} forms a commutative ring. This uses pointwise addition and Dirichlet convolution as multiplication. In fact, it is an integral domain. The multiplicative functions form a subgroup of the unit group of this ring. This algebraic viewpoint converts identity-hunting into ring-theoretic computation. Previously, identity-hunting required ad hoc divisor-sum manipulations. Now, inverses, associativity, and the behavior of convolution on prime powers become the tools of the trade. This article defines the Dirichlet product rigorously. It builds geometric intuition for what convolving over a divisor lattice means. It proves the multiplicativity-preservation theorem in full. It also works through two genuinely asymmetric examples to show the machinery in action. One example is combinatorial, counting divisor-pairs with a coprimality twist. The other involves μ\mu and σ\sigma. It closes with the doors this opens: Dirichlet Series and Euler Products and the full ring structure of The Ring of Arithmetic Functions.

Key takeaways
  • The Dirichlet convolution of f,g:Z+→Cf,g:\mathbb{Z}^+\to\mathbb{C} is (f∗g)(n)=∑d∣nf(d) g(n/d)(f*g)(n)=\sum_{d\mid n} f(d)\,g(n/d).
  • It is commutative, associative, and has identity element ε(n)=[n=1]\varepsilon(n)=[n=1].
  • Main theorem: if ff and gg are multiplicative, then f∗gf*g is multiplicative.
  • The proof uses that divisors d∣mnd\mid mn with gcd⁡(m,n)=1\gcd(m,n)=1 split uniquely as d=d1d2d=d_1d_2, d1∣md_1\mid m, d2∣nd_2\mid n.
  • Classical identities (∑d∣nφ(d)=n\sum_{d\mid n}\varphi(d)=n, ∑d∣nμ(d)=[n=1]\sum_{d\mid n}\mu(d)=[n=1]) are single convolution equations f∗1=gf*\mathbf{1}=g.
  • Key idea: Dirichlet convolution turns divisor-sum identities into ring arithmetic, and multiplicativity is exactly the property this ring operation respects.

Where this lives today

Dirichlet convolution is the algebraic backbone connecting elementary and analytic number theory. It is the mechanism behind Mobius Inversion: because 1∗μ=ε\mathbf 1 * \mu = \varepsilon (a fact you can verify is equivalent to ∑d∣nμ(d)=[n=1]\sum_{d\mid n}\mu(d)=[n=1]), any relation f=g∗1f = g*\mathbf 1 can be inverted to g=f∗μg = f*\mu, giving formulas for φ\varphi, μ\mu, and related sums that appear throughout combinatorics and cryptography (e.g., counting primitive roots or reduced residues). In analytic number theory, convolution is the coefficient-level shadow of multiplying Dirichlet Series and Euler Products: if F(s)=∑f(n)n−sF(s)=\sum f(n)n^{-s} and G(s)=∑g(n)n−sG(s)=\sum g(n)n^{-s} converge absolutely, then F(s)G(s)=∑n(f∗g)(n)n−sF(s)G(s) = \sum_n (f*g)(n) n^{-s}, which is exactly why the Euler product for the Riemann zeta function ζ(s)=∑n−s\zeta(s)=\sum n^{-s} factors over primes — the convolution identity 1=1∗ε\mathbf{1} = \mathbf{1} * \varepsilon and multiplicativity of τ,σ\tau, \sigma translate directly into product formulas. In algorithmic number theory and competitive programming, "sum over divisors" (SOS) convolution techniques for computing f∗gf*g for all n≤Nn\le N in O(Nlog⁡N)O(N\log N) time (a sieve-like divisor convolution) are used in Project Euler–style computations and in fast Möbius-transform algorithms for subset convolution in combinatorics. In cryptography, Euler's totient — itself built via φ=μ∗N\varphi = \mu * N — underlies RSA key generation, and multiplicativity of φ\varphi (a direct corollary of the theorem here) is what makes totient computation from a prime factorization tractable. The ring-theoretic viewpoint, made precise in The Ring of Arithmetic Functions, also underlies formal Dirichlet-series manipulations in random matrix theory and analytic approaches to the distribution of primes.

Ask the tutor: How does the multiplicativity of f∗gf*g let us derive a closed formula for φ(n)\varphi(n) or σ(n)\sigma(n) directly from the prime factorization of nn?

DefinitionDirichlet Convolution

An arithmetic function is a function f:Z+→Cf:\mathbb{Z}^{+}\to\mathbb{C}. Given two arithmetic functions ff and gg, their Dirichlet convolution (or Dirichlet product) is the arithmetic function f∗gf*g defined by

(f∗g)(n)  =  ∑d∣nf(d) g ⁣(nd)  =  ∑a,b≥1ab=nf(a)g(b),(f*g)(n) \;=\; \sum_{d\mid n} f(d)\,g\!\left(\frac{n}{d}\right) \;=\; \sum_{\substack{a,b\ge 1\\ ab=n}} f(a)g(b),

for every positive integer nn, where the sum runs over all positive divisors dd of nn. Recall (from Multiplicative Functions) that ff is multiplicative if ff is not identically zero and

f(mn)=f(m)f(n)whenever gcd⁡(m,n)=1.f(mn) = f(m)f(n) \quad \text{whenever } \gcd(m,n)=1.

Note every multiplicative function satisfies f(1)=1f(1)=1: taking m=n=1m=n=1 gives f(1)=f(1)2f(1)=f(1)^2, and f(1)=0f(1)=0 would force f≡0f\equiv 0 (since f(n)=f(n⋅1)=f(n)f(1)=0f(n)=f(n\cdot 1)=f(n)f(1)=0 for all nn once gcd⁡(n,1)=1\gcd(n,1)=1), contradicting non-vanishing.

Intuition

Picture the divisors of nn arranged on a number line from 11 up to nn, paired off as (d,n/d)(d, n/d) so that each pair multiplies back to nn. The convolution (f∗g)(n)(f*g)(n) is a weighted sum over all such pairings, with ff evaluated at one member of the pair and gg at the complementary member. It is the arithmetic analogue of convolving two sequences in signal processing, except that "shifting" is replaced by "dividing," and the ambient group (Z,+)(\mathbb{Z},+) is replaced by the divisibility poset of Z+\mathbb{Z}^+ under multiplication. The reason multiplicativity survives this operation is a lattice fact: if gcd⁡(m,n)=1\gcd(m,n)=1, every divisor of mnmn factors uniquely as a divisor of mm times a divisor of nn. So the divisor lattice of mnmn is literally the product of the divisor lattices of mm and of nn — a grid, not a tangled mess. Summing f(d1d2)g(mn/(d1d2))f(d_1d_2)g(mn/(d_1d_2)) over this grid separates into independent sums over the two factors, exactly mirroring how ff and gg themselves separate over coprime arguments.

Figure
Divisor lattice of 12=4⋅312 = 4\cdot 3 splits as a product of the lattices of 44 and 33
Divisors of 12 = divisors of 4 × divisors of 3 divisors of 4 divisors of 3 1 2 4 1 3 1 2 4 3 6 12

Each cell in that grid is a divisor d=d1d2d=d_1d_2 of 1212, uniquely built from a divisor d1∈{1,2,4}d_1\in\{1,2,4\} of 44 and d2∈{1,3}d_2\in\{1,3\} of 33. The convolution sum over all 66 divisors of 1212 is exactly the double sum over this 3×23\times 2 grid, which is the algebraic heart of the theorem below.

TheoremDirichlet Convolution Preserves Multiplicativity

Let f,g:Z+→Cf,g:\mathbb{Z}^+\to\mathbb{C} be multiplicative functions. Then f∗gf*g, defined by

(f∗g)(n)=∑d∣nf(d) g(n/d),(f*g)(n) = \sum_{d\mid n} f(d)\, g(n/d),

is also multiplicative. That is, f∗gf*g is not identically zero, and for all coprime positive integers m,nm,n,

(f∗g)(mn)=(f∗g)(m) (f∗g)(n).(f*g)(mn) = (f*g)(m)\,(f*g)(n).
LemmaDivisor Splitting for Coprime Moduli

Let m,nm,n be positive integers with gcd⁡(m,n)=1\gcd(m,n)=1. The map

Φ:{(d1,d2):d1∣m, d2∣n}⟶{d:d∣mn},Φ(d1,d2)=d1d2,\Phi:\{(d_1,d_2): d_1\mid m,\ d_2\mid n\} \longrightarrow \{d : d \mid mn\}, \qquad \Phi(d_1,d_2)=d_1d_2,

is a bijection. Moreover, if d=d1d2d=d_1d_2 under this correspondence, then

gcd⁡(d1,d2)=1,gcd⁡ ⁣(md1, nd2)=1,mnd=md1⋅nd2.\gcd(d_1,d_2)=1,\qquad \gcd\!\left(\frac{m}{d_1},\,\frac{n}{d_2}\right)=1,\qquad \frac{mn}{d} = \frac{m}{d_1}\cdot\frac{n}{d_2}.
Proof

Well-defined and lands in the target set. If d1∣md_1\mid m and d2∣nd_2\mid n, then d1d2∣mnd_1d_2 \mid mn, since d1d2d_1d_2 divides mnm n (write m=d1m′m = d_1 m', n=d2n′n=d_2n', so mn=(d1d2)(m′n′)mn = (d_1d_2)(m'n')). So Φ\Phi maps into divisors of mnmn.

Injectivity. Suppose Φ(d1,d2)=Φ(d1′,d2′)\Phi(d_1,d_2)=\Phi(d_1',d_2'), i.e. d1d2=d1′d2′d_1d_2=d_1'd_2', with d1,d1′∣md_1,d_1'\mid m and d2,d2′∣nd_2,d_2'\mid n. Since gcd⁡(m,n)=1\gcd(m,n)=1, also gcd⁡(d1,d2′)=1\gcd(d_1,d_2')=1 (as d1∣md_1\mid m, d2′∣nd_2'\mid n, and any common factor of d1,d2′d_1,d_2' would divide gcd⁡(m,n)=1\gcd(m,n)=1) and similarly gcd⁡(d1′,d2)=1\gcd(d_1',d_2)=1. From d1d2=d1′d2′d_1d_2 = d_1'd_2': since d1∣d1′d2′d_1 \mid d_1'd_2' and gcd⁡(d1,d2′)=1\gcd(d_1,d_2')=1, we get d1∣d1′d_1\mid d_1' by Euclid's lemma. By the symmetric argument d1′∣d1d_1'\mid d_1. Since both are positive integers, d1=d1′d_1=d_1', and then d2=d2′d_2=d_2' follows by cancellation. Hence Φ\Phi is injective.

Surjectivity. Let d∣mnd\mid mn. Define d1=gcd⁡(d,m)d_1=\gcd(d,m) and d2=gcd⁡(d,n)d_2=\gcd(d,n). Clearly d1∣md_1\mid m and d2∣nd_2\mid n. We claim d=d1d2d=d_1d_2. First, gcd⁡(d1,d2)=1\gcd(d_1,d_2)=1: any common divisor of d1d_1 and d2d_2 divides both mm and nn, hence divides gcd⁡(m,n)=1\gcd(m,n)=1. Next, since d1∣dd_1\mid d and d2∣dd_2\mid d and gcd⁡(d1,d2)=1\gcd(d_1,d_2)=1, we get d1d2∣dd_1d_2 \mid d. For the reverse divisibility, we use that d∣mnd\mid mn: write d∣mnd\mid mn; since gcd⁡(d/gcd⁡(d,m),m)\gcd(d/\gcd(d,m), m) considerations are delicate in general, instead argue via prime factorizations, which is airtight and elementary. For each prime pp, let vpv_p denote pp-adic valuation. Since gcd⁡(m,n)=1\gcd(m,n)=1, at most one of vp(m),vp(n)v_p(m), v_p(n) is nonzero for each prime pp. Because d∣mnd \mid mn, we have vp(d)≤vp(mn)=vp(m)+vp(n)v_p(d) \le v_p(mn) = v_p(m)+v_p(n), and since one of these two terms is 00, in fact vp(d)≤vp(m)v_p(d)\le v_p(m) or vp(d)≤vp(n)v_p(d)\le v_p(n) according to which of m,nm,n carries the prime pp (if neither carries pp then vp(d)=0v_p(d)=0 too). Concretely:

  • If vp(m)>0v_p(m)>0 and vp(n)=0v_p(n)=0: then vp(mn)=vp(m)v_p(mn)=v_p(m), so vp(d)≤vp(m)v_p(d)\le v_p(m), hence vp(d1)=min⁡(vp(d),vp(m))=vp(d)v_p(d_1)=\min(v_p(d),v_p(m))=v_p(d) and vp(d2)=min⁡(vp(d),vp(n))=min⁡(vp(d),0)=0v_p(d_2)=\min(v_p(d),v_p(n))=\min(v_p(d),0)=0. So vp(d1d2)=vp(d)v_p(d_1d_2)=v_p(d).
  • If vp(n)>0v_p(n)>0 and vp(m)=0v_p(m)=0: symmetric, vp(d1d2)=vp(d)v_p(d_1d_2)=v_p(d).
  • If vp(m)=vp(n)=0v_p(m)=v_p(n)=0: then vp(mn)=0v_p(mn)=0 so vp(d)=0=vp(d1)=vp(d2)v_p(d)=0=v_p(d_1)=v_p(d_2), so vp(d1d2)=0=vp(d)v_p(d_1d_2)=0=v_p(d).

Since m,nm,n coprime, every prime falls into exactly one of these three cases, so vp(d)=vp(d1d2)v_p(d)=v_p(d_1d_2) for all primes pp. Two positive integers with the same valuation at every prime are equal, so d=d1d2d=d_1d_2. This proves surjectivity, and simultaneously that the (d1,d2)(d_1,d_2) constructed from any dd via gcd⁡\gcd is exactly the preimage under Φ\Phi.

The remaining identities. We showed gcd⁡(d1,d2)=1\gcd(d_1,d_2)=1 above. Since gcd⁡(m,n)=1\gcd(m,n)=1 and d1∣md_1 \mid m, d2∣nd_2\mid n, the same valuation argument shows gcd⁡(m/d1,n/d2)=1\gcd(m/d_1, n/d_2) = 1: for each prime pp dividing mm (so not nn), vp(m/d1)=vp(m)−vp(d1)v_p(m/d_1) = v_p(m)-v_p(d_1) may be positive, but vp(n/d2)=vp(n)−vp(d2)=0−0=0v_p(n/d_2)=v_p(n)-v_p(d_2) = 0-0=0 since p∤np\nmid n; symmetrically for primes dividing nn; and primes dividing neither contribute 00 to both. Hence no prime divides both m/d1m/d_1 and n/d2n/d_2, giving coprimality. Finally,

mnd=mnd1d2=md1⋅nd2,\frac{mn}{d} = \frac{mn}{d_1d_2} = \frac{m}{d_1}\cdot\frac{n}{d_2},

which is immediate algebra once d=d1d2d=d_1d_2 is established. ■\blacksquare

∎
Proof

(Proof of the Main Theorem, using the Lemma.)

Non-vanishing. Since f,gf,g are multiplicative, f(1)=1f(1)=1 and g(1)=1g(1)=1 (shown in the Definition block). Then

(f∗g)(1)=∑d∣1f(d)g(1/d)=f(1)g(1)=1≠0,(f*g)(1) = \sum_{d\mid 1} f(d)g(1/d) = f(1)g(1) = 1 \ne 0,

so f∗gf*g is not the zero function.

Multiplicativity on coprime arguments. Let m,n∈Z+m,n\in\mathbb{Z}^+ with gcd⁡(m,n)=1\gcd(m,n)=1. By definition,

(f∗g)(mn)=∑d∣mnf(d) g ⁣(mnd).(f*g)(mn) = \sum_{d\mid mn} f(d)\, g\!\left(\frac{mn}{d}\right).

Apply the bijection Φ\Phi from the Lemma (Divisor Splitting for Coprime Moduli): every divisor dd of mnmn is uniquely d=d1d2d=d_1d_2 with d1∣md_1\mid m, d2∣nd_2\mid n, and moreover mn/d=(m/d1)(n/d2)mn/d = (m/d_1)(n/d_2). Reindex the sum over d∣mnd\mid mn as a double sum over d1∣md_1\mid m and d2∣nd_2\mid n:

(f∗g)(mn)=∑d1∣m ∑d2∣nf(d1d2) g ⁣(md1⋅nd2).(f*g)(mn) = \sum_{d_1\mid m}\ \sum_{d_2\mid n} f(d_1d_2)\, g\!\left(\frac{m}{d_1}\cdot\frac{n}{d_2}\right).

Now use multiplicativity of ff and of gg. We showed in the Lemma that gcd⁡(d1,d2)=1\gcd(d_1,d_2)=1 (as d1∣md_1\mid m, d2∣nd_2\mid n, gcd⁡(m,n)=1\gcd(m,n)=1), so

f(d1d2)=f(d1)f(d2).f(d_1d_2) = f(d_1)f(d_2).

Likewise gcd⁡(m/d1, n/d2)=1\gcd(m/d_1,\,n/d_2)=1 was shown in the Lemma, so

g ⁣(md1⋅nd2)=g ⁣(md1)g ⁣(nd2).g\!\left(\frac{m}{d_1}\cdot\frac{n}{d_2}\right) = g\!\left(\frac{m}{d_1}\right) g\!\left(\frac{n}{d_2}\right).

Substituting,

(f∗g)(mn)=∑d1∣m∑d2∣nf(d1)g ⁣(md1)f(d2)g ⁣(nd2).(f*g)(mn) = \sum_{d_1\mid m}\sum_{d_2\mid n} f(d_1)g\!\left(\frac{m}{d_1}\right) f(d_2) g\!\left(\frac{n}{d_2}\right).

The summand factors as a product of a term depending only on d1d_1 and a term depending only on d2d_2, so the double sum splits into a product of two single sums:

(f∗g)(mn)=(∑d1∣mf(d1)g ⁣(md1))(∑d2∣nf(d2)g ⁣(nd2))=(f∗g)(m) (f∗g)(n).(f*g)(mn) = \left(\sum_{d_1\mid m} f(d_1)g\!\left(\frac{m}{d_1}\right)\right)\left(\sum_{d_2\mid n} f(d_2)g\!\left(\frac{n}{d_2}\right)\right) = (f*g)(m)\,(f*g)(n).

This is exactly the multiplicativity condition for f∗gf*g at the coprime pair (m,n)(m,n). Since m,nm,n were an arbitrary coprime pair, and we already showed f∗g≢0f*g\not\equiv 0, we conclude f∗gf*g is multiplicative. ■\blacksquare

∎

Proof technique. This is a direct combinatorial/algebraic proof by reindexing a divisor sum via a bijection induced by coprimality, followed by factoring a double sum into a product of single sums — the standard technique for all multiplicativity-preservation arguments in elementary number theory (it recurs verbatim when proving σ\sigma, τ\tau, φ\varphi, μ\mu multiplicative, and when proving Dirichlet series multiply as Euler products).

CorollaryThe Multiplicative Functions Form a Monoid Under Convolution

Let ε\varepsilon denote the arithmetic function with ε(1)=1\varepsilon(1)=1 and ε(n)=0\varepsilon(n)=0 for n>1n>1. Then ε\varepsilon is multiplicative, f∗ε=ε∗f=ff*\varepsilon = \varepsilon*f = f for every arithmetic function ff, and the theorem above shows the set of multiplicative functions is closed under ∗* and contains ε\varepsilon. In particular it is a monoid under Dirichlet convolution.

Proof

ε\varepsilon is multiplicative: ε(1)=1≠0\varepsilon(1)=1\ne 0, and for coprime m,nm,n, if either exceeds 11 then ε(mn)=0\varepsilon(mn)=0 (since mn>1mn>1 unless m=n=1m=n=1) while at least one of ε(m),ε(n)\varepsilon(m),\varepsilon(n) is 00, so the product is 00 too; if m=n=1m=n=1, ε(1)=1=ε(1)ε(1)\varepsilon(1)=1=\varepsilon(1)\varepsilon(1). So ε(mn)=ε(m)ε(n)\varepsilon(mn)=\varepsilon(m)\varepsilon(n) always holds for coprime m,nm,n. For the identity property, directly:

(f∗ε)(n)=∑d∣nf(d)ε(n/d).(f*\varepsilon)(n) = \sum_{d\mid n} f(d)\varepsilon(n/d).

The only divisor dd contributing a nonzero term is the one with n/d=1n/d=1, i.e. d=nd=n, contributing f(n)ε(1)=f(n)f(n)\varepsilon(1)=f(n). So (f∗ε)(n)=f(n)(f*\varepsilon)(n)=f(n) for all nn; commutativity of ∗* (immediate from the symmetric definition (f∗g)(n)=∑ab=nf(a)g(b)=(g∗f)(n)(f*g)(n)=\sum_{ab=n} f(a)g(b) = (g*f)(n)) gives ε∗f=f\varepsilon * f = f too. Closure of multiplicative functions under ∗* is the Main Theorem. ■\blacksquare

∎

Worked examples

Example 1: Convolving μ\mu (Möbius function) with NN (identity power function), asymmetric and nontrivial. Let μ\mu be the Möbius function, μ(1)=1\mu(1)=1, μ(n)=(−1)k\mu(n)=(-1)^k if nn is a product of kk distinct primes, and μ(n)=0\mu(n)=0 if nn has a squared prime factor. Let N(n)=nN(n)=n (the identity function on Z+\mathbb{Z}^+, viewed as an arithmetic function). Both are multiplicative: NN trivially since N(mn)=mn=N(m)N(n)N(mn)=mn=N(m)N(n) always; μ\mu is a standard fact we take as known (it will itself be proved multiplicative by an argument identical in spirit to the one above, applied to the specific definition of μ\mu). We compute (μ∗N)(n)(\mu * N)(n) for the concrete, asymmetric value n=20=22⋅5n = 20 = 2^2\cdot 5. The divisors of 2020 are 1,2,4,5,10,201,2,4,5,10,20. By definition,

(μ∗N)(20)=∑d∣20μ(d) N(20/d)=∑d∣20μ(d)⋅20d.(\mu*N)(20) = \sum_{d\mid 20} \mu(d)\, N(20/d) = \sum_{d\mid 20}\mu(d)\cdot \frac{20}{d}.

Tabulate:

ddμ(d)\mu(d)20/d20/dμ(d)⋅(20/d)\mu(d)\cdot(20/d)
112020
2-110-10
4050
5-14-4
10122
20010

Sum: 20−10+0−4+2+0=820-10+0-4+2+0 = 8. Now check this against the general identity μ∗N=φ\mu * N = \varphi (Euler's totient), a classical fact (indeed φ(n)=∑d∣nμ(d)(n/d)\varphi(n)=\sum_{d\mid n}\mu(d)(n/d) is one standard formula for φ\varphi). We should get φ(20)\varphi(20). Since 20=4⋅520=4\cdot 5 with gcd⁡(4,5)=1\gcd(4,5)=1 and φ\varphi multiplicative, φ(20)=φ(4)φ(5)=2⋅4=8\varphi(20)=\varphi(4)\varphi(5) = 2\cdot 4 = 8. This matches our direct computation of 88 exactly, confirming both the arithmetic and the identity μ∗N=φ\mu*N=\varphi on this nontrivial, non-symmetric case (note 2020 is not a prime power and not squarefree, a genuinely mixed test case). We can also verify multiplicativity of μ∗N\mu*N itself directly at n=20=4⋅5n=20=4\cdot5 using our theorem, since it guarantees (μ∗N)(20)=(μ∗N)(4)⋅(μ∗N)(5)(\mu*N)(20) = (\mu*N)(4)\cdot(\mu*N)(5) without recomputing the 6-term sum. Compute the two smaller convolutions:

(μ∗N)(4)=∑d∣4μ(d)4d=μ(1)⋅4+μ(2)⋅2+μ(4)⋅1=4−2+0=2,(\mu*N)(4) = \sum_{d\mid 4}\mu(d)\frac{4}{d} = \mu(1)\cdot4+\mu(2)\cdot2+\mu(4)\cdot1 = 4 - 2 + 0 = 2,
(μ∗N)(5)=∑d∣5μ(d)5d=μ(1)⋅5+μ(5)⋅1=5−1=4.(\mu*N)(5) = \sum_{d\mid 5}\mu(d)\frac{5}{d} = \mu(1)\cdot 5+\mu(5)\cdot 1 = 5-1=4.

Then the theorem predicts (μ∗N)(20)=2⋅4=8(\mu*N)(20)=2\cdot 4=8, matching the value 88 computed directly from all six divisors of 2020. This is precisely the content of the Main Theorem verified on real numbers: the six-term sum over 2020's divisor lattice collapses to the product of a two-term sum (over 44's divisors) and a two-term sum (over 55's divisors), exactly as the divisor-splitting lemma predicts.

Example 2: A convolution not of two "named" functions — building σ\sigma from NN and the constant function 1\mathbf{1}, tested at n=45n=45. Let 1(n)=1\mathbf{1}(n)=1 for all nn (constant function, multiplicative since 1⋅1=11\cdot1=1 for all coprime pairs), and let N(n)=nN(n)=n as before. Consider (1∗N)(n)=∑d∣nN(d)=∑d∣nd=σ(n)(\mathbf{1}*N)(n) = \sum_{d\mid n} N(d) = \sum_{d\mid n} d = \sigma(n), the sum-of-divisors function. This is by definition the classical identity σ=1∗N\sigma = \mathbf{1}*N. Take the asymmetric test case n=45=9⋅5=32⋅5n=45 = 9\cdot 5 = 3^2\cdot 5. Divisors of 4545: 1,3,5,9,15,451,3,5,9,15,45. Direct sum:

σ(45)=1+3+5+9+15+45=78.\sigma(45) = 1+3+5+9+15+45 = 78.

Now use the Main Theorem: since 1\mathbf{1} and NN are both multiplicative, σ=1∗N\sigma=\mathbf{1}*N is multiplicative, so for the coprime factorization 45=9⋅545 = 9\cdot 5,

σ(45)=σ(9)⋅σ(5).\sigma(45) = \sigma(9)\cdot\sigma(5).

Compute each factor from its own (smaller) divisor sum: divisors of 99 are 1,3,91,3,9, giving σ(9)=1+3+9=13\sigma(9)=1+3+9=13; divisors of 55 are 1,51,5, giving σ(5)=1+5=6\sigma(5)=1+5=6. Then

σ(9)⋅σ(5)=13⋅6=78,\sigma(9)\cdot\sigma(5) = 13\cdot 6 = 78,

which matches the direct 6-term computation exactly. Notice the saving in labor: instead of summing over all 66 divisors of 4545, multiplicativity (guaranteed by the theorem, since it applies to any pair of multiplicative functions, not just famous ones) lets us work with the 33 divisors of 99 and 22 divisors of 55 separately — a 66-term sum reduced to a 33-term and a 22-term sum, a pattern that becomes dramatic for highly composite nn.

CounterexampleDropping "multiplicative" for a merely additive-type function breaks the theorem

The theorem requires both ff and gg to be multiplicative in the sense f(mn)=f(m)f(n)f(mn)=f(m)f(n) for coprime m,nm,n (with f(1)=1f(1)=1, non-vanishing). If we instead take a completely additive function — one satisfying f(mn)=f(m)+f(n)f(mn)=f(m)+f(n) for all m,nm,n (not a multiplicative condition at all) — the convolution need not even resemble a multiplicative function, and the clean factorization fails. Concretely, let f=g=Ωf=g=\Omega, where Ω(n)\Omega(n) is the number of prime factors of nn counted with multiplicity (so Ω(1)=0\Omega(1)=0, Ω(12)=Ω(22⋅3)=3\Omega(12)=\Omega(2^2\cdot3)=3). This Ω\Omega satisfies Ω(mn)=Ω(m)+Ω(n)\Omega(mn)=\Omega(m)+\Omega(n) for all m,n≥1m,n\ge 1 (completely additive), but it is not multiplicative in our sense: multiplicativity requires f(1)=1f(1)=1, yet Ω(1)=0\Omega(1)=0. So Ω\Omega fails the hypothesis of the theorem outright (it is not even in the class of functions the theorem discusses), and indeed Ω\Omega is identically satisfying f(1)=0f(1)=0, which for a multiplicative function would force f≡0f\equiv 0 — but Ω≢0\Omega\not\equiv 0. So Ω\Omega is a legitimate arithmetic function that is simply outside the multiplicative class. Test what happens to Ω∗Ω\Omega * \Omega at the coprime pair m=2, n=3m=2,\,n=3. Compute directly:

(Ω∗Ω)(6)=∑d∣6Ω(d)Ω(6/d)=Ω(1)Ω(6)+Ω(2)Ω(3)+Ω(3)Ω(2)+Ω(6)Ω(1).(\Omega*\Omega)(6) = \sum_{d\mid 6}\Omega(d)\Omega(6/d) = \Omega(1)\Omega(6)+\Omega(2)\Omega(3)+\Omega(3)\Omega(2)+\Omega(6)\Omega(1).

With Ω(1)=0, Ω(2)=1, Ω(3)=1, Ω(6)=2\Omega(1)=0,\ \Omega(2)=1,\ \Omega(3)=1,\ \Omega(6)=2:

(Ω∗Ω)(6)=0⋅2+1⋅1+1⋅1+2⋅0=0+1+1+0=2.(\Omega*\Omega)(6) = 0\cdot2 + 1\cdot1+1\cdot1+2\cdot0 = 0+1+1+0=2.

Now compute (Ω∗Ω)(2)(\Omega*\Omega)(2) and (Ω∗Ω)(3)(\Omega*\Omega)(3) separately:

(Ω∗Ω)(2)=Ω(1)Ω(2)+Ω(2)Ω(1)=0+0=0,(\Omega*\Omega)(2) = \Omega(1)\Omega(2)+\Omega(2)\Omega(1) = 0+0=0,
(Ω∗Ω)(3)=Ω(1)Ω(3)+Ω(3)Ω(1)=0+0=0.(\Omega*\Omega)(3) = \Omega(1)\Omega(3)+\Omega(3)\Omega(1) = 0+0=0.

If Ω∗Ω\Omega*\Omega were multiplicative we would need (Ω∗Ω)(6)=(Ω∗Ω)(2)⋅(Ω∗Ω)(3)=0⋅0=0(\Omega*\Omega)(6) = (\Omega*\Omega)(2)\cdot(\Omega*\Omega)(3) = 0\cdot 0 = 0. But we computed (Ω∗Ω)(6)=2≠0(\Omega*\Omega)(6)=2\ne 0. The multiplicativity identity fails completely, precisely because Ω\Omega was never a multiplicative function to begin with — it violates the hypothesis f(1)=1f(1)=1 that the theorem's proof relies on (recall the very first line of the Main Theorem's proof used f(1)=g(1)=1f(1)=g(1)=1 to get (f∗g)(1)=1≠0(f*g)(1)=1\ne0; here (Ω∗Ω)(1)=Ω(1)Ω(1)=0(\Omega*\Omega)(1)=\Omega(1)\Omega(1)=0, already signaling Ω∗Ω\Omega*\Omega cannot be multiplicative since a multiplicative function must take value 11 at n=1n=1). This shows the multiplicativity hypothesis on the inputs f,gf,g is not a cosmetic assumption — remove it, and the conclusion can fail outright, even at the smallest possible coprime pair (2,3)(2,3).

Scope, edge cases & common traps

SituationWhat holdsWhat can fail
f,gf,g both multiplicativef∗gf*g multiplicative (Main Theorem)—
ff multiplicative, gg arbitrary (not multiplicative)no guaranteef∗gf*g need not be multiplicative
f(1)=0f(1)=0 for some inputinput is not multiplicative by definitionconclusion of theorem inapplicable, as in the Counterexample
f,gf,g completely multiplicative (f(mn)=f(m)f(n)f(mn)=f(m)f(n) for all m,nm,n, not just coprime)f∗gf*g is multiplicative, but generally not completely multiplicativecommon trap: assuming convolution preserves the stronger "completely multiplicative" property
n=1n=1(f∗g)(1)=f(1)g(1)=1(f*g)(1)=f(1)g(1)=1 automatically once f,gf,g multiplicativeeasy to forget to check this base case in a from-scratch proof

The mathematician behind it

Origins · 1 minJohann Peter Gustav Lejeune Dirichlet and how this was discovered
JP
Johann Peter Gustav Lejeune Dirichlet
1805–1859 · Prussia/Germany, analytic number theory

Dirichlet is best known for proving that every arithmetic progression a,a+m,a+2m,…a, a+m, a+2m,\dots with gcd⁡(a,m)=1\gcd(a,m)=1 contains infinitely many primes, using what are now called Dirichlet characters and Dirichlet L-functions. The convolution operation named after him arises naturally from his study of Dirichlet series ∑nf(n)n−s\sum_n f(n)n^{-s}: multiplying two such series and collecting terms by common exponent produces exactly the Dirichlet convolution of the coefficient sequences, which is why the same name attaches to both the series and the product of arithmetic functions.

History
- 1805 — Dirichlet born in Düren, then part of the French Empire.
- 1837 — proves the theorem on primes in arithmetic progressions, introducing Dirichlet characters and L-functions.
- 1839 — Dirichlet's work on generating series of arithmetic functions crystallizes the convolution structure later formalized under his name.
- 1859 — Dirichlet dies in Göttingen; his number-theoretic lecture notes are edited and published by Dedekind shortly after.
- 20th century — the convolution is formalized as ring multiplication on arithmetic functions, becoming standard machinery in analytic and algebraic number theory texts (Hardy–Wright, Apostol).
Why is the Dirichlet convolution defined the way it is, rather than some other divisor sum?

The specific pairing (d,n/d)(d, n/d) is forced by wanting the operation to correspond to multiplying formal Dirichlet series: if F(s)=∑nf(n)n−sF(s)=\sum_n f(n)n^{-s} and G(s)=∑ng(n)n−sG(s)=\sum_n g(n) n^{-s}, expanding the product F(s)G(s)F(s)G(s) and collecting all terms with the same combined exponent n=abn=ab produces exactly ∑n(∑d∣nf(d)g(n/d))n−s\sum_n \left(\sum_{d\mid n} f(d)g(n/d)\right)n^{-s}. So Dirichlet convolution is precisely the coefficient-multiplication rule matching series multiplication, in the same way ordinary (Cauchy) convolution of sequences matches multiplication of power series. This series-level motivation is why the operation, though defined purely combinatorially here, reappears throughout analytic number theory.

Is Dirichlet convolution commutative and associative, and does that matter for this article?

Yes to both, and it matters because it means "the multiplicative functions form a monoid" is a meaningful, checkable algebraic statement rather than an approximation. Commutativity is immediate: (f∗g)(n)=∑ab=nf(a)g(b)=∑ba=ng(b)f(a)=(g∗f)(n)(f*g)(n)=\sum_{ab=n}f(a)g(b)=\sum_{ba=n}g(b)f(a)=(g*f)(n), since the sum is symmetric under swapping the roles of a,ba,b. Associativity follows by expanding ((f∗g)∗h)(n)((f*g)*h)(n) and (f∗(g∗h))(n)(f*(g*h))(n) into triple sums over ordered factorizations n=abcn=abc; both equal ∑abc=nf(a)g(b)h(c)\sum_{abc=n} f(a)g(b)h(c), so they agree. These facts underlie the full ring structure developed in The Ring of Arithmetic Functions.

Does the theorem say anything about f+gf+g (pointwise sum) being multiplicative?

No, and in general it is false. Multiplicativity is not preserved by pointwise addition even when both summands are multiplicative. For instance, take f=g=1f=g=\mathbf 1 (constant function 11, multiplicative). Then (f+g)(n)=2(f+g)(n)=2 for all nn, so (f+g)(1)=2≠1(f+g)(1)=2\ne 1, which already disqualifies f+gf+g from being multiplicative by the normalization requirement h(1)=1h(1)=1. This is one reason Dirichlet convolution, not pointwise addition, is the natural "multiplication" to pair with pointwise addition when building the ring of arithmetic functions.

How does this theorem relate to Möbius inversion?

Möbius inversion is essentially a corollary of the convolution framework together with the specific fact 1∗μ=ε\mathbf 1 * \mu = \varepsilon (equivalently ∑d∣nμ(d)=[n=1]\sum_{d\mid n}\mu(d) = [n=1]). If g(n)=∑d∣nf(d)=(f∗1)(n)g(n) = \sum_{d\mid n} f(d) = (f*\mathbf1)(n), convolving both sides on the right by μ\mu gives g∗μ=f∗1∗μ=f∗ε=fg*\mu = f*\mathbf1*\mu = f*\varepsilon = f, using associativity and commutativity of ∗*. So f(n)=∑d∣nμ(d)g(n/d)f(n)=\sum_{d\mid n}\mu(d) g(n/d). The multiplicativity-preservation theorem then explains why, whenever gg is multiplicative, f=g∗μf=g*\mu is automatically multiplicative too (since μ\mu itself is multiplicative), which is exactly why formulas recovered by Möbius inversion (like the formula for φ\varphi from n=∑d∣nφ(d)n=\sum_{d\mid n}\varphi(d)) come out multiplicative "for free."

Can Dirichlet convolution be computed efficiently for all nn up to some bound NN?

Yes. A direct computation of (f∗g)(n)(f*g)(n) for a single nn takes time proportional to the number of divisors of nn. To compute (f∗g)(n)(f*g)(n) for all n≤Nn\le N simultaneously, one uses a sieve: for each aa from 11 to NN and each multiple n=ab≤Nn=ab\le N, accumulate f(a)g(b)f(a)g(b) into a running total for nn. This costs O(Nlog⁡N)O(N\log N) time in total (a harmonic-sum argument, since the number of multiples of aa up to NN is ⌊N/a⌋\lfloor N/a\rfloor, and ∑a=1NN/a=O(Nlog⁡N)\sum_{a=1}^N N/a = O(N\log N)). This is the standard technique for tabulating φ\varphi, μ\mu, σ\sigma, and related functions in computational number theory.

Is the ring of arithmetic functions under (+,∗)(+,*) an integral domain?

Yes, though proving it is beyond the present scope. One shows that if f,g≢0f,g\not\equiv 0, then letting aa be the smallest integer with f(a)≠0f(a)\ne 0 and bb the smallest with g(b)≠0g(b)\ne 0, the coefficient (f∗g)(ab)=∑d∣abf(d)g(ab/d)(f*g)(ab) = \sum_{d\mid ab} f(d)g(ab/d) has all terms zero except possibly d=ad=a (any smaller divisor d<ad<a forces f(d)=0f(d)=0 by minimality of aa, and any dd with ab/d<bab/d < b, i.e. d>ad>a, forces g(ab/d)=0g(ab/d)=0 by minimality of bb; a short divisibility argument confirms d=ad=a is the only surviving term when gcd⁡\gcd-type ambiguity is ruled out for the minimal-index term), giving (f∗g)(ab)=f(a)g(b)≠0(f*g)(ab)=f(a)g(b)\ne 0. So f∗g≢0f*g\not\equiv 0, meaning there are no zero divisors — the ring is an integral domain. This fact is developed fully in The Ring of Arithmetic Functions.

Before this

Where this leads