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 , 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 , and the identity function. The central fact proved here is a preservation theorem. If and are Multiplicative Functions, then so is . 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 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 and . It closes with the doors this opens: Dirichlet Series and Euler Products and the full ring structure of The Ring of Arithmetic Functions.
- The Dirichlet convolution of is .
- It is commutative, associative, and has identity element .
- Main theorem: if and are multiplicative, then is multiplicative.
- The proof uses that divisors with split uniquely as , , .
- Classical identities (, ) are single convolution equations .
- 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 (a fact you can verify is equivalent to ), any relation can be inverted to , giving formulas for , , 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 and converge absolutely, then , which is exactly why the Euler product for the Riemann zeta function factors over primes — the convolution identity and multiplicativity of translate directly into product formulas. In algorithmic number theory and competitive programming, "sum over divisors" (SOS) convolution techniques for computing for all in 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 — underlies RSA key generation, and multiplicativity of (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 let us derive a closed formula for or directly from the prime factorization of ?
An arithmetic function is a function . Given two arithmetic functions and , their Dirichlet convolution (or Dirichlet product) is the arithmetic function defined by
for every positive integer , where the sum runs over all positive divisors of . Recall (from Multiplicative Functions) that is multiplicative if is not identically zero and
Note every multiplicative function satisfies : taking gives , and would force (since for all once ), contradicting non-vanishing.
Intuition
Picture the divisors of arranged on a number line from up to , paired off as so that each pair multiplies back to . The convolution is a weighted sum over all such pairings, with evaluated at one member of the pair and 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 is replaced by the divisibility poset of under multiplication. The reason multiplicativity survives this operation is a lattice fact: if , every divisor of factors uniquely as a divisor of times a divisor of . So the divisor lattice of is literally the product of the divisor lattices of and of — a grid, not a tangled mess. Summing over this grid separates into independent sums over the two factors, exactly mirroring how and themselves separate over coprime arguments.
Each cell in that grid is a divisor of , uniquely built from a divisor of and of . The convolution sum over all divisors of is exactly the double sum over this grid, which is the algebraic heart of the theorem below.
Let be multiplicative functions. Then , defined by
is also multiplicative. That is, is not identically zero, and for all coprime positive integers ,
Let be positive integers with . The map
is a bijection. Moreover, if under this correspondence, then
Well-defined and lands in the target set. If and , then , since divides (write , , so ). So maps into divisors of .
Injectivity. Suppose , i.e. , with and . Since , also (as , , and any common factor of would divide ) and similarly . From : since and , we get by Euclid's lemma. By the symmetric argument . Since both are positive integers, , and then follows by cancellation. Hence is injective.
Surjectivity. Let . Define and . Clearly and . We claim . First, : any common divisor of and divides both and , hence divides . Next, since and and , we get . For the reverse divisibility, we use that : write ; since considerations are delicate in general, instead argue via prime factorizations, which is airtight and elementary. For each prime , let denote -adic valuation. Since , at most one of is nonzero for each prime . Because , we have , and since one of these two terms is , in fact or according to which of carries the prime (if neither carries then too). Concretely:
- If and : then , so , hence and . So .
- If and : symmetric, .
- If : then so , so .
Since coprime, every prime falls into exactly one of these three cases, so for all primes . Two positive integers with the same valuation at every prime are equal, so . This proves surjectivity, and simultaneously that the constructed from any via is exactly the preimage under .
The remaining identities. We showed above. Since and , , the same valuation argument shows : for each prime dividing (so not ), may be positive, but since ; symmetrically for primes dividing ; and primes dividing neither contribute to both. Hence no prime divides both and , giving coprimality. Finally,
which is immediate algebra once is established.
∎(Proof of the Main Theorem, using the Lemma.)
Non-vanishing. Since are multiplicative, and (shown in the Definition block). Then
so is not the zero function.
Multiplicativity on coprime arguments. Let with . By definition,
Apply the bijection from the Lemma (Divisor Splitting for Coprime Moduli): every divisor of is uniquely with , , and moreover . Reindex the sum over as a double sum over and :
Now use multiplicativity of and of . We showed in the Lemma that (as , , ), so
Likewise was shown in the Lemma, so
Substituting,
The summand factors as a product of a term depending only on and a term depending only on , so the double sum splits into a product of two single sums:
This is exactly the multiplicativity condition for at the coprime pair . Since were an arbitrary coprime pair, and we already showed , we conclude is multiplicative.
∎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 , , , multiplicative, and when proving Dirichlet series multiply as Euler products).
Let denote the arithmetic function with and for . Then is multiplicative, for every arithmetic function , and the theorem above shows the set of multiplicative functions is closed under and contains . In particular it is a monoid under Dirichlet convolution.
is multiplicative: , and for coprime , if either exceeds then (since unless ) while at least one of is , so the product is too; if , . So always holds for coprime . For the identity property, directly:
The only divisor contributing a nonzero term is the one with , i.e. , contributing . So for all ; commutativity of (immediate from the symmetric definition ) gives too. Closure of multiplicative functions under is the Main Theorem.
∎Worked examples
Example 1: Convolving (Möbius function) with (identity power function), asymmetric and nontrivial. Let be the Möbius function, , if is a product of distinct primes, and if has a squared prime factor. Let (the identity function on , viewed as an arithmetic function). Both are multiplicative: trivially since always; 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 ). We compute for the concrete, asymmetric value . The divisors of are . By definition,
Tabulate:
| 1 | 1 | 20 | 20 |
| 2 | -1 | 10 | -10 |
| 4 | 0 | 5 | 0 |
| 5 | -1 | 4 | -4 |
| 10 | 1 | 2 | 2 |
| 20 | 0 | 1 | 0 |
Sum: . Now check this against the general identity (Euler's totient), a classical fact (indeed is one standard formula for ). We should get . Since with and multiplicative, . This matches our direct computation of exactly, confirming both the arithmetic and the identity on this nontrivial, non-symmetric case (note is not a prime power and not squarefree, a genuinely mixed test case). We can also verify multiplicativity of itself directly at using our theorem, since it guarantees without recomputing the 6-term sum. Compute the two smaller convolutions:
Then the theorem predicts , matching the value computed directly from all six divisors of . This is precisely the content of the Main Theorem verified on real numbers: the six-term sum over 's divisor lattice collapses to the product of a two-term sum (over 's divisors) and a two-term sum (over 's divisors), exactly as the divisor-splitting lemma predicts.
Example 2: A convolution not of two "named" functions — building from and the constant function , tested at . Let for all (constant function, multiplicative since for all coprime pairs), and let as before. Consider , the sum-of-divisors function. This is by definition the classical identity . Take the asymmetric test case . Divisors of : . Direct sum:
Now use the Main Theorem: since and are both multiplicative, is multiplicative, so for the coprime factorization ,
Compute each factor from its own (smaller) divisor sum: divisors of are , giving ; divisors of are , giving . Then
which matches the direct 6-term computation exactly. Notice the saving in labor: instead of summing over all divisors of , multiplicativity (guaranteed by the theorem, since it applies to any pair of multiplicative functions, not just famous ones) lets us work with the divisors of and divisors of separately — a -term sum reduced to a -term and a -term sum, a pattern that becomes dramatic for highly composite .
The theorem requires both and to be multiplicative in the sense for coprime (with , non-vanishing). If we instead take a completely additive function — one satisfying for all (not a multiplicative condition at all) — the convolution need not even resemble a multiplicative function, and the clean factorization fails. Concretely, let , where is the number of prime factors of counted with multiplicity (so , ). This satisfies for all (completely additive), but it is not multiplicative in our sense: multiplicativity requires , yet . So fails the hypothesis of the theorem outright (it is not even in the class of functions the theorem discusses), and indeed is identically satisfying , which for a multiplicative function would force — but . So is a legitimate arithmetic function that is simply outside the multiplicative class. Test what happens to at the coprime pair . Compute directly:
With :
Now compute and separately:
If were multiplicative we would need . But we computed . The multiplicativity identity fails completely, precisely because was never a multiplicative function to begin with — it violates the hypothesis that the theorem's proof relies on (recall the very first line of the Main Theorem's proof used to get ; here , already signaling cannot be multiplicative since a multiplicative function must take value at ). This shows the multiplicativity hypothesis on the inputs is not a cosmetic assumption — remove it, and the conclusion can fail outright, even at the smallest possible coprime pair .
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| both multiplicative | multiplicative (Main Theorem) | — |
| multiplicative, arbitrary (not multiplicative) | no guarantee | need not be multiplicative |
| for some input | input is not multiplicative by definition | conclusion of theorem inapplicable, as in the Counterexample |
| completely multiplicative ( for all , not just coprime) | is multiplicative, but generally not completely multiplicative | common trap: assuming convolution preserves the stronger "completely multiplicative" property |
| automatically once multiplicative | easy 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
Dirichlet is best known for proving that every arithmetic progression with 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 : 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.
Why is the Dirichlet convolution defined the way it is, rather than some other divisor sum?
The specific pairing is forced by wanting the operation to correspond to multiplying formal Dirichlet series: if and , expanding the product and collecting all terms with the same combined exponent produces exactly . 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: , since the sum is symmetric under swapping the roles of . Associativity follows by expanding and into triple sums over ordered factorizations ; both equal , so they agree. These facts underlie the full ring structure developed in The Ring of Arithmetic Functions.
Does the theorem say anything about (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 (constant function , multiplicative). Then for all , so , which already disqualifies from being multiplicative by the normalization requirement . 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 (equivalently ). If , convolving both sides on the right by gives , using associativity and commutativity of . So . The multiplicativity-preservation theorem then explains why, whenever is multiplicative, is automatically multiplicative too (since itself is multiplicative), which is exactly why formulas recovered by Möbius inversion (like the formula for from ) come out multiplicative "for free."
Can Dirichlet convolution be computed efficiently for all up to some bound ?
Yes. A direct computation of for a single takes time proportional to the number of divisors of . To compute for all simultaneously, one uses a sieve: for each from to and each multiple , accumulate into a running total for . This costs time in total (a harmonic-sum argument, since the number of multiples of up to is , and ). This is the standard technique for tabulating , , , 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 , then letting be the smallest integer with and the smallest with , the coefficient has all terms zero except possibly (any smaller divisor forces by minimality of , and any with , i.e. , forces by minimality of ; a short divisibility argument confirms is the only surviving term when -type ambiguity is ruled out for the minimal-index term), giving . So , meaning there are no zero divisors — the ring is an integral domain. This fact is developed fully in The Ring of Arithmetic Functions.