Skip to content

Möbius Function

The Möbius function is an arithmetic function denoted by

Definition

The Möbius function is an arithmetic function denoted by

μ(n). \mu(n).

It is defined from the prime factorization of nn.

For n=1n=1,

μ(1)=1. \mu(1)=1.

For n>1n>1, write

n=p1α1p2α2prαr. n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}.

Then

μ(n)={0,if some αi2,(1)r,if every αi=1. \mu(n)= \begin{cases} 0, & \text{if some } \alpha_i\ge2,\\ (-1)^r, & \text{if every } \alpha_i=1. \end{cases}

Thus μ(n)\mu(n) detects whether nn is squarefree, and if it is squarefree, records the parity of the number of prime factors.

Squarefree Integers

An integer nn is squarefree if no prime square divides it.

Equivalently, in its prime factorization,

n=p1α1prαr, n=p_1^{\alpha_1}\cdots p_r^{\alpha_r},

all exponents satisfy

αi=1. \alpha_i=1.

For example,

30=235 30=2\cdot3\cdot5

is squarefree, while

12=223 12=2^2\cdot3

is not squarefree because 22122^2\mid12.

The Möbius function vanishes exactly on non-squarefree integers.

Examples

The first values are

μ(1)=1, \mu(1)=1, μ(2)=1,μ(3)=1, \mu(2)=-1, \qquad \mu(3)=-1,

because 22 and 33 each have one prime factor.

Also,

μ(6)=1, \mu(6)=1,

because

6=23 6=2\cdot3

has two distinct prime factors.

On the other hand,

μ(4)=0,μ(8)=0,μ(12)=0, \mu(4)=0, \qquad \mu(8)=0, \qquad \mu(12)=0,

because each is divisible by a square greater than 11.

For

42=237, 42=2\cdot3\cdot7,

we have

μ(42)=(1)3=1. \mu(42)=(-1)^3=-1.

Multiplicativity

The Möbius function is multiplicative. If

gcd(a,b)=1, \gcd(a,b)=1,

then

μ(ab)=μ(a)μ(b). \mu(ab)=\mu(a)\mu(b).

This follows directly from prime factorization. If either aa or bb is divisible by a square, then abab is divisible by a square, and both sides are 00. If both are squarefree, then abab is squarefree, and the number of prime factors of abab is the sum of the number of prime factors of aa and bb.

Thus the signs multiply correctly:

(1)r+s=(1)r(1)s. (-1)^{r+s}=(-1)^r(-1)^s.

The function is not completely multiplicative, since

μ(2)μ(2)=1, \mu(2)\mu(2)=1,

but

μ(4)=0. \mu(4)=0.

Sum over Divisors

The Möbius function satisfies the fundamental identity

dnμ(d)={1,n=1,0,n>1. \sum_{d\mid n}\mu(d) = \begin{cases} 1, & n=1,\\ 0, & n>1. \end{cases}

This identity is central.

To see why, let

n=p1α1prαr. n=p_1^{\alpha_1}\cdots p_r^{\alpha_r}.

Only squarefree divisors contribute to the sum, because μ(d)=0\mu(d)=0 for non-squarefree dd. A squarefree divisor is obtained by choosing a subset of the primes

p1,,pr. p_1,\ldots,p_r.

If the subset has size kk, its contribution is

(1)k. (-1)^k.

Therefore

dnμ(d)=k=0r(rk)(1)k=(11)r. \sum_{d\mid n}\mu(d) = \sum_{k=0}^{r} \binom{r}{k}(-1)^k = (1-1)^r.

If n=1n=1, then r=0r=0, and the sum is 11. If n>1n>1, then r1r\ge1, and the sum is 00.

The Inversion Role

The identity

dnμ(d)=0(n>1) \sum_{d\mid n}\mu(d)=0 \quad(n>1)

shows that μ\mu behaves like an inverse to the constant function 11 under divisor summation.

If

F(n)=dnf(d), F(n)=\sum_{d\mid n} f(d),

then the Möbius function allows one to recover ff from FF. The formula is

f(n)=dnμ(d)F(nd). f(n)=\sum_{d\mid n}\mu(d)F\left(\frac nd\right).

This is Möbius inversion, which will be studied in detail later.

The Möbius function is therefore not only a detector of squarefreeness. It is also the arithmetic function that reverses divisor summation.

Relation to Coprimality

The Möbius function can express coprimality.

For positive integers aa and bb,

dgcd(a,b)μ(d)={1,gcd(a,b)=1,0,gcd(a,b)>1. \sum_{d\mid \gcd(a,b)}\mu(d) = \begin{cases} 1, & \gcd(a,b)=1,\\ 0, & \gcd(a,b)>1. \end{cases}

Thus the expression

da, dbμ(d) \sum_{d\mid a,\ d\mid b}\mu(d)

acts as an indicator for the condition

gcd(a,b)=1. \gcd(a,b)=1.

This is useful because it converts a coprimality condition into a divisor sum, which can often be manipulated algebraically.

Squarefree Counting

The Möbius function also counts squarefree integers.

An integer nn is squarefree if and only if

μ(n)2=1. \mu(n)^2=1.

If nn is not squarefree, then

μ(n)2=0. \mu(n)^2=0.

Thus μ(n)2\mu(n)^2 is the indicator function of squarefreeness.

For example,

μ(30)2=1, \mu(30)^2=1,

while

μ(12)2=0. \mu(12)^2=0.

This simple observation appears often in analytic number theory.

Role in Number Theory

The Möbius function is one of the main arithmetic functions because it encodes cancellation. Its values are 11, 1-1, and 00, but these small values carry precise factorization information.

It detects squarefree integers, records the parity of prime factors, inverts divisor sums, expresses coprimality, and appears in formulas for prime distribution.

The central idea is that inclusion-exclusion over prime divisors is built into μ(n)\mu(n). This makes the Möbius function a bridge between prime factorization and summation over divisors.