Mobius Inversion

Suppose you know, for every positive integer nn, the sum of a mystery function ff over all divisors of nn. Can you recover ff itself? This is not idle curiosity. Euler's totient function φ\varphi, the divisor-counting function dd, and the sum-of-divisors function σ\sigma are all easiest to define through such divisor sums. Yet number theorists constantly need to invert the relationship. They need to strip away the summation and isolate the original function. Möbius inversion answers this question completely and explicitly. It uses nothing more than the arithmetic properties of the Mobius Function μ\mu. The idea matters because it converts a huge class of "summed" identities into "unsummed" identities and back. It does this essentially for free. Once you know that g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d), Möbius inversion hands you f(n)=∑d∣nμ(n/d)g(d)f(n) = \sum_{d \mid n} \mu(n/d) g(d) with no further work. This single formula unifies dozens of classical identities in elementary number theory. These include the totient sum, the identity ∑d∣nμ(d)=[n=1]\sum_{d\mid n}\mu(d)=[n=1], and formulas for counting irreducible polynomials over finite fields. It also includes formulas in combinatorics (inclusion–exclusion on the divisor lattice). All of these fall under one algebraic umbrella. The big picture is that Möbius inversion is really a statement about invertibility. This invertibility lives in the Ring of Arithmetic Functions under Dirichlet Convolution. The divisor sum g=f∗1g = f * \mathbf{1} is a convolution with the constant function 1(n)=1\mathbf{1}(n) = 1. And μ\mu is precisely the Dirichlet inverse of 1\mathbf{1}. Once this is understood, Möbius inversion is not a clever trick. It is an immediate consequence of associativity in a ring. This is the same mechanism that lets you cancel a nonzero real number by multiplying by its reciprocal. This article gives the precise formal statement. It includes a fully rigorous proof from first principles. A second proof via the convolution ring is also given, to show both viewpoints. There are two worked examples with genuinely different flavors. A counterexample shows why the divisor-sum hypothesis cannot be weakened. Finally, there is a survey of where this circle of ideas resurfaces. It resurfaces from cryptography to combinatorics to the analytic study of average orders.

Key takeaways
  • Möbius inversion recovers ff from g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d) via f(n)=∑d∣nμ(n/d)g(d)f(n) = \sum_{d\mid n} \mu(n/d)g(d).
  • It rests on one identity: ∑d∣nμ(d)=[n=1]\sum_{d \mid n} \mu(d) = [n=1] (the Iverson bracket).
  • Equivalently, μ\mu is the Dirichlet convolution inverse of the constant function 1\mathbf{1}.
  • Classical payoffs: φ(n)=∑d∣nμ(d) n/d\varphi(n) = \sum_{d\mid n} \mu(d)\, n/d, and inversion of d(n)d(n), σ(n)\sigma(n) identities.
  • The formula is a two-way street: it converts unsummed formulas into summed ones just as easily.
  • Key idea: inversion is convolution by an inverse element, so it works whenever 1\mathbf{1} has an inverse — which it always does.

Where this lives today

Möbius inversion is a load-bearing tool well beyond its origin. In analytic number theory it underlies the study of average orders of arithmetic functions such as φ\varphi, dd, and σ\sigma, since inverting a divisor-sum relation is often the first step in extracting asymptotics — a theme picked up directly in the study of Average Order of Arithmetic Functions. In algebra and combinatorics, the same cancellation phenomenon generalizes to the Möbius function of an arbitrary locally finite partially ordered set (Rota's theory of Möbius functions on posets), with the divisor lattice as the motivating special case; this recovers inclusion–exclusion on finite sets as another instance of the same abstract machinery. In finite fields and coding theory, as in the worked example above, Möbius inversion gives exact formulas for the number of irreducible polynomials of each degree, which feeds directly into constructions of finite fields used in error-correcting codes and in cryptographic primitives built over F2n\mathbb{F}_{2^n}. In cryptography more broadly, cyclotomic polynomials — defined via a Möbius-inverted product formula over divisors of nn — appear in the design of discrete-log-based systems and in analyzing the structure of multiplicative groups modulo primes. In combinatorics on necklaces and dynamical systems, Möbius inversion counts the number of aperiodic binary necklaces of a given length, connecting directly to counting periodic points of the shift map and to de Bruijn sequences. Even in statistical mechanics, cluster-expansion techniques for computing free energies use Möbius-type inversions on lattices of subsets, echoing the same alternating-sign cancellation seen in the Lemma above.

Ask the tutor: How does Möbius inversion generalize to the Möbius function of an arbitrary partially ordered set, and how does that recover ordinary inclusion–exclusion as a special case?

DefinitionMöbius function and Möbius inversion

The Möbius function μ:Z>0→{−1,0,1}\mu : \mathbb{Z}_{>0} \to \{-1,0,1\} is defined by

μ(n)={1n=1,(−1)kn=p1p2⋯pk for distinct primes p1,…,pk,0if p2∣n for some prime p.\mu(n) = \begin{cases} 1 & n = 1,\\ (-1)^k & n = p_1 p_2 \cdots p_k \text{ for distinct primes } p_1,\dots,p_k,\\ 0 & \text{if } p^2 \mid n \text{ for some prime } p. \end{cases}

Given arithmetic functions f,g:Z>0→Cf, g : \mathbb{Z}_{>0} \to \mathbb{C}, say that gg is the divisor sum of ff if

g(n)=∑d∣nf(d)for every n≥1,g(n) = \sum_{d \mid n} f(d) \qquad \text{for every } n \ge 1,

where the sum runs over all positive divisors dd of nn. The Möbius inversion formula asserts that in this situation,

f(n)=∑d∣nμ ⁣(nd)g(d)for every n≥1,f(n) = \sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) g(d) \qquad \text{for every } n \ge 1,

and conversely that this equation forces gg to be the divisor sum of ff. Thus the two displayed equations are logically equivalent, for arbitrary f,g:Z>0→Cf,g:\mathbb{Z}_{>0}\to\mathbb{C}.

Intuition

Think of the divisors of nn as forming a small partially ordered set under divisibility — a lattice. The equation g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d) says that gg at nn "collects" all the values of ff sitting below nn in this lattice. This is exactly the same shape as inclusion–exclusion: if gg counts something cumulative over a family of nested sets, ff is the "new content added at level dd," and recovering ff from gg should involve alternating sums, since inclusion–exclusion always does. The Möbius function is engineered to be the correct alternating-sign machine for the divisor lattice. Its defining property, ∑d∣nμ(d)=[n=1]\sum_{d\mid n}\mu(d) = [n=1], says that if you sum μ\mu over the divisors of n>1n>1, the positive and negative contributions from square-free divisors with even versus odd numbers of prime factors cancel exactly. This is inclusion–exclusion over the set of prime divisors of nn: squarefree divisors correspond to subsets of primes, and μ\mu assigns (−1)∣S∣(-1)^{|S|} to the subset SS. The picture below shows the divisor lattice of n=12n = 12 with μ\mu-values labeled on each divisor, illustrating both facts used in the proof: which divisors are squarefree (nonzero μ\mu) and how the alternating signs cancel.

Figure
Divisor lattice of 12 with Möbius values, illustrating cancellation
1 μ=1 2 μ=−1 3 μ=−1 4 μ=0 6 μ=1 9 n/a 12 divisor of 12 Divisors of 12: 1,2,3,4,6,12. Sum of μ over them: 1−1−1+0+1+0 = 0.

The two-way bridge

The intuition to keep is that Möbius inversion is a change of coordinates: it re-expresses the same information (the function ff) using a different, more convenient generating rule (partial sums over divisors instead of raw values). Once you see μ\mu as the multiplicative inverse of the all-ones function under Dirichlet convolution, the inversion formula stops looking like magic and starts looking like solving g=f⋅1g = f\cdot 1 for ff by multiplying both sides by 1−11^{-1}.

TheoremMöbius Inversion Formula

Let f,g:Z>0→Cf, g : \mathbb{Z}_{>0} \to \mathbb{C} be arithmetic functions. Then the following two statements are equivalent:

(A) For every positive integer nn,

g(n)=∑d∣nf(d).g(n) = \sum_{d \mid n} f(d).

(B) For every positive integer nn,

f(n)=∑d∣nμ ⁣(nd)g(d).f(n) = \sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) g(d).
LemmaFundamental property of μ\mu

For every positive integer nn,

∑d∣nμ(d)=[n=1]:={1n=10n>1.\sum_{d \mid n} \mu(d) = [n = 1] := \begin{cases} 1 & n=1 \\ 0 & n > 1.\end{cases}
Proof

Proof of the Lemma. The case n=1n=1 is immediate: the only divisor of 11 is 11 itself, and μ(1)=1\mu(1)=1. Now let n>1n > 1 and write its prime factorization as n=p1a1⋯pkakn = p_1^{a_1}\cdots p_k^{a_k} with k≥1k \ge 1 distinct primes p1,…,pkp_1,\dots,p_k and exponents ai≥1a_i \ge 1. By definition, μ(d)=0\mu(d) = 0 whenever dd is divisible by the square of a prime, so the sum ∑d∣nμ(d)\sum_{d\mid n}\mu(d) receives nonzero contributions only from the squarefree divisors of nn. Every squarefree divisor of nn has the form d=∏i∈Spid = \prod_{i \in S} p_i for a subset S⊆{1,…,k}S \subseteq \{1,\dots,k\}, and distinct subsets give distinct squarefree divisors (this uses unique factorization, since the pip_i are distinct primes). For such dd, μ(d)=(−1)∣S∣\mu(d) = (-1)^{|S|} by definition. Hence

∑d∣nμ(d)=∑S⊆{1,…,k}(−1)∣S∣=∑j=0k(kj)(−1)j=(1−1)k=0,\sum_{d \mid n} \mu(d) = \sum_{S \subseteq \{1,\dots,k\}} (-1)^{|S|} = \sum_{j=0}^{k} \binom{k}{j} (-1)^j = (1-1)^k = 0,

using the binomial theorem with k≥1k \ge 1. This proves the lemma. ■\blacksquare

∎
Proof

Proof of the Theorem. We prove (A) ⇒\Rightarrow (B) and (B) ⇒\Rightarrow (A) directly, each via a double-sum rearrangement over the divisor lattice — the technique is swapping the order of summation in a sum indexed by pairs (d,e)(d,e) with de∣nde \mid n, which is valid because we are summing finitely many complex numbers and addition of finitely many terms is commutative and associative (no convergence issues arise, as every sum below is over a finite index set).

(A) ⇒\Rightarrow (B). Assume g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d) for all nn. Fix n≥1n \ge 1 and compute the right side of (B):

∑d∣nμ ⁣(nd)g(d)=∑d∣nμ ⁣(nd)∑e∣df(e).\sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) g(d) = \sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) \sum_{e \mid d} f(e).

Substitute the hypothesis for g(d)g(d) inside the outer sum. The index set of the double sum is

{(d,e):d∣n, e∣d}.\{(d,e) : d \mid n,\ e \mid d\}.

Because divisibility is transitive, this set equals

{(d,e):e∣n, d∣n, e∣d}={(e,d):e∣n, e∣d∣n}.\{(d,e) : e \mid n,\ d \mid n,\ e \mid d\} = \{(e,d) : e \mid n,\ e \mid d \mid n\}.

More usefully, fix e∣ne \mid n first; then dd ranges over all divisors of nn that are multiples of ee, i.e. d=emd = e m where mm ranges over the divisors of n/en/e (this is a standard divisor bijection: d∣nd \mid n and e∣de \mid d if and only if d=emd = em for some m∣n/em \mid n/e, using that Z>0\mathbb{Z}_{>0} has unique factorization so divisibility chains correspond exactly to quotients). Reindexing the double sum by first choosing e∣ne \mid n and then m∣(n/e)m \mid (n/e), with d=emd = em, gives

∑d∣nμ ⁣(nd)∑e∣df(e)=∑e∣nf(e)∑m∣(n/e)μ ⁣(nem).\sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) \sum_{e \mid d} f(e) = \sum_{e \mid n} f(e) \sum_{m \mid (n/e)} \mu\!\left(\frac{n}{em}\right).

Here we used that as dd ranges over multiples of ee dividing nn, the ratio n/dn/d ranges over the divisors of n/en/e (specifically n/d=(n/e)/mn/d = (n/e)/m), so μ(n/d)=μ((n/e)/m)\mu(n/d) = \mu\big((n/e)/m\big). Now apply the Lemma to the inner sum with n/en/e in place of nn: setting m′=(n/e)/mm' = (n/e)/m, as mm ranges over divisors of n/en/e so does m′m', hence

∑m∣(n/e)μ ⁣((n/e)m)=∑m′∣(n/e)μ(m′)=[ n/e=1 ]=[ e=n ].\sum_{m \mid (n/e)} \mu\!\left(\frac{(n/e)}{m}\right) = \sum_{m' \mid (n/e)} \mu(m') = [\,n/e = 1\,] = [\,e = n\,].

Substituting back,

∑e∣nf(e) [e=n]=f(n),\sum_{e \mid n} f(e)\, [e = n] = f(n),

since the only term surviving in the sum over e∣ne \mid n is e=ne = n. This proves (B).

(B) ⇒\Rightarrow (A). Assume f(n)=∑d∣nμ(n/d)g(d)f(n) = \sum_{d\mid n} \mu(n/d) g(d) for all nn. We must verify g(n)=∑e∣nf(e)g(n) = \sum_{e \mid n} f(e). Compute, using the hypothesis for each f(e)f(e) with e∣ne \mid n:

∑e∣nf(e)=∑e∣n∑d∣eμ ⁣(ed)g(d).\sum_{e \mid n} f(e) = \sum_{e \mid n} \sum_{d \mid e} \mu\!\left(\frac{e}{d}\right) g(d).

Again this is a sum over pairs (e,d)(e,d) with d∣e∣nd \mid e \mid n. Fix d∣nd \mid n first; then ee ranges over multiples of dd dividing nn, i.e. e=dke = d k with k∣(n/d)k \mid (n/d). Reindexing:

∑e∣n∑d∣eμ ⁣(ed)g(d)=∑d∣ng(d)∑k∣(n/d)μ(k),\sum_{e \mid n} \sum_{d \mid e} \mu\!\left(\frac{e}{d}\right) g(d) = \sum_{d \mid n} g(d) \sum_{k \mid (n/d)} \mu(k),

where we used e/d=ke/d = k directly this time. By the Lemma applied to n/dn/d,

∑k∣(n/d)μ(k)=[ n/d=1 ]=[ d=n ].\sum_{k \mid (n/d)} \mu(k) = [\,n/d = 1\,] = [\,d = n\,].

So the whole expression collapses to

∑d∣ng(d) [d=n]=g(n).\sum_{d \mid n} g(d)\,[d=n] = g(n).

This proves (A), completing the equivalence. ■\blacksquare

∎
CorollaryConvolution-ring restatement

Let 1\mathbf{1} denote the arithmetic function with 1(n)=1\mathbf{1}(n) = 1 for all nn, and let ε\varepsilon denote the identity for Dirichlet Convolution, ε(1)=1\varepsilon(1)=1 and ε(n)=0\varepsilon(n)=0 for n>1n>1. Then μ\mu is the Dirichlet inverse of 1\mathbf{1}, i.e. μ∗1=ε\mu * \mathbf{1} = \varepsilon, and statements (A), (B) of the theorem are exactly the equations

g=f∗1⟺f=μ∗g,g = f * \mathbf{1} \qquad \Longleftrightarrow \qquad f = \mu * g,

in the Ring of Arithmetic Functions under Dirichlet convolution.

Proof

By definition, (f∗g)(n)=∑d∣nf(d) g(n/d)(f*g)(n) = \sum_{d\mid n} f(d)\,g(n/d). The Lemma states precisely that (μ∗1)(n)=∑d∣nμ(d)1(n/d)=∑d∣nμ(d)=[n=1]=ε(n)(\mu * \mathbf{1})(n) = \sum_{d\mid n}\mu(d)\mathbf{1}(n/d) = \sum_{d\mid n}\mu(d) = [n=1] = \varepsilon(n), so μ∗1=ε\mu * \mathbf{1} = \varepsilon. Since Dirichlet convolution is associative and commutative on arithmetic functions with ε\varepsilon as two-sided identity (a fact established when the Ring of Arithmetic Functions is constructed, and used here without reproof since it does not depend on Möbius inversion), if g=f∗1g = f * \mathbf{1} then convolving both sides on the left by μ\mu gives

μ∗g=μ∗(f∗1)=(μ∗f)∗1=f∗(μ∗1)=f∗ε=f,\mu * g = \mu * (f * \mathbf{1}) = (\mu * f)*\mathbf 1= f*(\mu * \mathbf{1}) = f * \varepsilon = f,

which is statement (B), since (μ∗g)(n)=∑d∣nμ(d)g(n/d)=∑d∣nμ(n/d)g(d)(\mu*g)(n) = \sum_{d\mid n}\mu(d)g(n/d) = \sum_{d\mid n}\mu(n/d)g(d) (reindexing d↔n/dd \leftrightarrow n/d). Conversely if f=μ∗gf = \mu * g, convolving by 1\mathbf 1 gives f∗1=μ∗g∗1=g∗ε=gf * \mathbf 1 = \mu*g*\mathbf 1 = g * \varepsilon = g, which is (A). This gives an independent, purely algebraic proof of the Theorem, not relying on the combinatorial double-sum argument. ■\blacksquare

∎

Worked examples

Example 1: Recovering φ\varphi from the identity ∑d∣nφ(d)=n\sum_{d\mid n} \varphi(d) = n. It is a standard fact (provable directly by partitioning {1,…,n}\{1,\dots,n\} according to gcd⁡\gcd with nn) that Euler's totient function satisfies

n=∑d∣nφ(d)for every n≥1.n = \sum_{d \mid n} \varphi(d) \qquad \text{for every } n \ge 1.

This says g(n)=ng(n) = n is the divisor sum of f=φf = \varphi. By Möbius inversion,

φ(n)=∑d∣nμ ⁣(nd)d.\varphi(n) = \sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) d.

Let us verify this concretely for the asymmetric case n=60=22⋅3⋅5n = 60 = 2^2\cdot 3\cdot 5, whose divisors are

1,2,3,4,5,6,10,12,15,20,30,60.1,2,3,4,5,6,10,12,15,20,30,60.

We need μ(60/d)\mu(60/d) for each divisor dd:

dd60/d60/dμ(60/d)\mu(60/d)contribution μ(60/d)⋅d\mu(60/d)\cdot d
160μ(60)=0\mu(60)=0 (4∣604\mid 60)0
230μ(30)=μ(2⋅3⋅5)=−1\mu(30)=\mu(2\cdot3\cdot5)=-1−2-2
320μ(20)=0\mu(20)=0 (4∣204\mid 20)0
415μ(15)=μ(3⋅5)=1\mu(15)=\mu(3\cdot5)=144
512μ(12)=0\mu(12)=0 (4∣124\mid 12)0
610μ(10)=μ(2⋅5)=1\mu(10)=\mu(2\cdot5)=166
106μ(6)=μ(2⋅3)=1\mu(6)=\mu(2\cdot3)=11010
125μ(5)=−1\mu(5)=-1−12-12
154μ(4)=0\mu(4)=00
203μ(3)=−1\mu(3)=-1−20-20
302μ(2)=−1\mu(2)=-1−30-30
601μ(1)=1\mu(1)=16060

Summing the contributions:

0−2+0+4+0+6+10−12+0−20−30+60=16.0 -2+0+4+0+6+10-12+0-20-30+60 = 16.

Independently, the standard formula φ(n)=n∏p∣n(1−1/p)\varphi(n) = n\prod_{p\mid n}(1 - 1/p) gives

φ(60)=60⋅(1−12)(1−13)(1−15)=60⋅12⋅23⋅45=16.\varphi(60) = 60 \cdot \left(1-\tfrac12\right)\left(1-\tfrac13\right)\left(1-\tfrac15\right) = 60\cdot\frac12\cdot\frac23\cdot\frac45 = 16.

The two computations agree, confirming both the inversion formula and the arithmetic.

Example 2: Counting monic irreducible polynomials over F2\mathbb{F}_2. Over the finite field F2\mathbb{F}_2, every monic polynomial of degree nn factors uniquely into monic irreducibles, and comparing degrees on both sides of X2n−X=∏(irreducibles of degree d, d∣n)X^{2^n} - X = \prod (\text{irreducibles of degree } d,\ d\mid n) yields the identity (a standard fact from finite field theory, taken here as given)

2n=∑d∣nd⋅I(d),2^n = \sum_{d \mid n} d \cdot I(d),

where I(d)I(d) denotes the number of monic irreducible polynomials of degree dd over F2\mathbb{F}_2. Setting f(d)=d⋅I(d)f(d) = d\cdot I(d) and g(n)=2ng(n) = 2^n, this is exactly a divisor-sum relation g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d), so Möbius inversion gives

n⋅I(n)=∑d∣nμ ⁣(nd)2d,I(n)=1n∑d∣nμ ⁣(nd)2d.n \cdot I(n) = \sum_{d \mid n} \mu\!\left(\frac{n}{d}\right) 2^{d}, \qquad I(n) = \frac{1}{n}\sum_{d\mid n} \mu\!\left(\frac{n}{d}\right) 2^d.

Let us compute I(6)I(6), an asymmetric case with two distinct prime factors in the exponent. Divisors of 66 are 1,2,3,61,2,3,6.

dd6/d6/dμ(6/d)\mu(6/d)2d2^dproduct
16μ(6)=1\mu(6)=122
23μ(3)=−1\mu(3)=-14−4-4
32μ(2)=−1\mu(2)=-18−8-8
61μ(1)=1\mu(1)=16464

Sum: 2−4−8+64=542 - 4 - 8 + 64 = 54. Then

I(6)=546=9.I(6) = \frac{54}{6} = 9.

So there are exactly 99 monic irreducible polynomials of degree 66 over F2\mathbb{F}_2. As a sanity check via the recursive structure: I(1)=2I(1)=2 (namely X,X+1X, X+1), I(2)=(22−2)/2=1I(2) = (2^2-2)/2 = 1, I(3)=(23−2)/3=2I(3) = (2^3-2)/3=2, and the degree-6 count should satisfy 6⋅9+3⋅2+2⋅1+1⋅2=54+6+2+2=64=266\cdot 9 + 3\cdot 2 + 2\cdot1 + 1\cdot 2 = 54 + 6 + 2 + 2 = 64 = 2^6, which checks out exactly against the original (non-inverted) identity for n=6n=6.

Counterexamplewhy the "for every nn" divisor-sum hypothesis cannot be replaced by a single instance

The theorem requires that g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d) hold for all positive integers nn simultaneously — not merely at one value of nn, and not merely for nn in some proper subset of Z>0\mathbb{Z}_{>0}. If this global hypothesis is weakened to holding only at a single nn, or only along a sparse set of nn's, the inversion formula fails. Concretely, take f1(n)=1f_1(n) = 1 for all nn (so f1=1f_1 = \mathbf{1}) and let f2f_2 be any function agreeing with f1f_1 on all divisors of 66 but differing elsewhere — say

f2(n)={1n≠5100n=5.f_2(n) = \begin{cases} 1 & n \ne 5 \\ 100 & n = 5.\end{cases}

Define g(n)=∑d∣nf1(d)=d(n)g(n) = \sum_{d\mid n} f_1(d) = d(n), the number-of-divisors function. Then in particular

g(6)=∑d∣6f1(d)=4=∑d∣6f2(d),g(6) = \sum_{d \mid 6} f_1(d) = 4 = \sum_{d\mid 6} f_2(d),

since 5∤65 \nmid 6, so this single instance of the divisor-sum relation holds equally well for f1f_1 and for f2f_2. If one attempted to "invert at n=6n=6 only," there is no way to distinguish f1f_1 from f2f_2 — both are consistent with the same single equation. But the two functions are not equal, so they cannot both satisfy the full inversion formula f(n)=∑d∣nμ(n/d)g(d)f(n) = \sum_{d\mid n}\mu(n/d)g(d) for the same gg at every nn: indeed applying the correctly-stated theorem to the true global relation g=f1∗1g = f_1 * \mathbf 1 recovers f1f_1 uniquely at every nn, including n=5n=5, where it correctly gives f1(5)=1≠100=f2(5)f_1(5)=1 \ne 100 = f_2(5). The moral: Möbius inversion is a statement about two entire functions related at every positive integer, and no finite truncation of the hypothesis suffices to pin down ff uniquely — the "for every nn" quantifier is essential, not a stylistic convenience.

Scope, edge cases & common traps

SituationWhat happens
g(n)=∑d∣nf(d)g(n) = \sum_{d\mid n} f(d) known for all nnInversion recovers ff exactly and uniquely, by the Theorem.
Relation known only for finitely many nn, or only nn in a proper sub-semigroupInversion formula does not apply; ff is underdetermined, as the counterexample shows.
f,gf,g complex-valued, not just real or integerNo change — the proof never uses positivity, integrality, or any ordering; only finite-sum algebra.
Multiplicativity of ffNot required for inversion to hold, but if gg is multiplicative and ff's divisor sum equals gg, then ff is automatically multiplicative too (a separate, provable fact about Dirichlet convolution of multiplicative functions).
Using ∑d∣n\sum_{d\mid n} vs. ∑d≤n\sum_{d\le n}These are different operations entirely; Möbius inversion as stated concerns only the divisor sum, not partial sums over an interval (a related but distinct "Möbius summation" exists via ∑d≤xμ(d)⌊x/d⌋\sum_{d\le x}\mu(d)\lfloor x/d\rfloor type identities, not covered by this theorem).

The mathematician behind it

Origins · 1 minAugust Ferdinand Möbius and how this was discovered
AF
August Ferdinand Möbius
1790–1868 · German mathematician and astronomer, University of Leipzig

Möbius worked across geometry, astronomy, and number theory, and is best remembered publicly for the one-sided surface that bears his name. In number theory, he introduced the function μ\mu and the inversion formula in an 1832 paper, motivated by problems in combinatorial counting that he had encountered while studying the structure of finite groups of permutations of divisors — an early instance of the inclusion–exclusion idea being made fully algebraic.

History
- 1790 — August Ferdinand Möbius born in Schulpforta, Saxony.
- 1815 — Becomes an astronomer and later professor at Leipzig, working under Gauss's influence in Göttingen.
- 1832 — Publishes "Über eine besondere Art von Umkehrung der Reihen," introducing μ\mu and the inversion formula.
- 1858 — Discovers the one-sided surface later named the Möbius strip (independently of Listing).
- 1868 — Dies in Leipzig; his number-theoretic function becomes foundational to 20th-century analytic number theory.
Do ff and gg need to be multiplicative for Möbius inversion to apply?

No. The Theorem as proved makes no assumption of multiplicativity, complete multiplicativity, or even non-negativity of ff or gg; the argument is a purely combinatorial rearrangement of finite sums over divisors, valid for arbitrary complex-valued arithmetic functions. Multiplicativity becomes relevant only as a bonus: if gg happens to be multiplicative, one can show separately (using properties of Dirichlet convolution of multiplicative functions) that the resulting ff is automatically multiplicative as well, which is often a useful sanity check but never a hypothesis of the inversion theorem itself.

Is there a version of Möbius inversion for sums over an interval 1,…,n1,\dots,n instead of divisors of nn?

Yes, and it is a genuinely different (though related) tool sometimes called "Möbius summation" or used in proving ∑n≤xμ(n)/n→0\sum_{n\le x}\mu(n)/n \to 0-type results; it involves double sums of the form ∑d≤xμ(d)h(x/d)\sum_{d\le x}\mu(d)h(x/d) and connects to the Average Order of Arithmetic Functions. It is not the same statement as the divisor-sum inversion proved here, and applying the divisor-sum formula to an interval sum is a common source of error — the index sets ("divisors of nn" versus "integers up to xx") are structurally different.

Why does μ(n)=0\mu(n)=0 whenever nn has a squared prime factor?

This is a definitional choice, but it is exactly the choice needed to make the fundamental Lemma true. If μ\mu were instead defined only on squarefree numbers by (−1)(number of prime factors)(-1)^{(\text{number of prime factors})} and left undefined (or nonzero) on non-squarefree numbers, the identity ∑d∣nμ(d)=[n=1]\sum_{d\mid n}\mu(d) = [n=1] would fail for numbers like n=4n=4, since 44's divisors 1,2,41,2,4 would then contribute μ(1)+μ(2)+μ(4)\mu(1)+\mu(2)+\mu(4) with μ(4)\mu(4) not forced to vanish, breaking the binomial-theorem cancellation used in the proof.

Can Möbius inversion be used to define μ\mu rather than the other way around?

In a sense, yes — one common approach is to define μ\mu as the unique Dirichlet inverse of 1\mathbf{1} (i.e., the unique function with μ∗1=ε\mu * \mathbf{1} = \varepsilon), and then derive its explicit prime-factorization formula as a theorem. This article took the historical order (explicit formula first, inversion second), but the two developments are logically equivalent, and the convolution-ring proof given above makes the equivalence completely transparent.

Does the formula still work if nn is replaced by an arbitrary positive real, or must nn be a positive integer?

The formula as stated is only meaningful for positive integers nn, since "divisors of nn" and the prime factorization used to define μ\mu both require n∈Z>0n \in \mathbb{Z}_{>0}. There is no direct extension to non-integer or negative arguments within this framework; generalizations instead go through Dirichlet series (where μ(n)\mu(n) appears as coefficients of 1/ζ(s)1/\zeta(s)) or through Möbius functions of more general partially ordered sets, which is a different — though philosophically related — construction.

What is the fastest way to remember the formula without re-deriving it?

Think of g=f∗1g = f * \mathbf{1}, read as "gg equals ff convolved with the all-ones function," and recall that μ\mu is the Dirichlet inverse of 1\mathbf{1}. Then inversion is just "divide by 1\mathbf 1," i.e. convolve by μ\mu: f=μ∗gf = \mu * g. Writing this out termwise gives exactly f(n)=∑d∣nμ(n/d)g(d)f(n) = \sum_{d\mid n}\mu(n/d)g(d), and the mnemonic "μ\mu undoes 1\mathbf 1" is enough to reconstruct the whole formula on demand.

Does the sign pattern of μ(n/d)\mu(n/d) have any interpretation, or is it just "whatever makes the algebra work"?

It has a clean interpretation: μ(n/d)\mu(n/d) is nonzero only when n/dn/d is squarefree, and its sign is (−1)(number of distinct primes dividing n/d)(-1)^{(\text{number of distinct primes dividing } n/d)}. This is exactly the inclusion–exclusion sign for "correcting" overcounts introduced by summing ff over all divisors: each additional prime factor in n/dn/d represents one more layer of overcounting to be alternately added and subtracted, mirroring inclusion–exclusion over the set of primes dividing nn.

Before this

Where this leads