# Möbius Function

## Definition

The Möbius function is an arithmetic function denoted by

$$
\mu(n).
$$

It is defined from the prime factorization of $n$.

For $n=1$,

$$
\mu(1)=1.
$$

For $n>1$, write

$$
n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots p_r^{\alpha_r}.
$$

Then

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

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

## Squarefree Integers

An integer $n$ is squarefree if no prime square divides it.

Equivalently, in its prime factorization,

$$
n=p_1^{\alpha_1}\cdots p_r^{\alpha_r},
$$

all exponents satisfy

$$
\alpha_i=1.
$$

For example,

$$
30=2\cdot3\cdot5
$$

is squarefree, while

$$
12=2^2\cdot3
$$

is not squarefree because $2^2\mid12$.

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

## Examples

The first values are

$$
\mu(1)=1,
$$

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

because $2$ and $3$ each have one prime factor.

Also,

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

because

$$
6=2\cdot3
$$

has two distinct prime factors.

On the other hand,

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

because each is divisible by a square greater than $1$.

For

$$
42=2\cdot3\cdot7,
$$

we have

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

## Multiplicativity

The Möbius function is multiplicative. If

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

then

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

This follows directly from prime factorization. If either $a$ or $b$ is divisible by a square, then $ab$ is divisible by a square, and both sides are $0$. If both are squarefree, then $ab$ is squarefree, and the number of prime factors of $ab$ is the sum of the number of prime factors of $a$ and $b$.

Thus the signs multiply correctly:

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

The function is not completely multiplicative, since

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

but

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

## Sum over Divisors

The Möbius function satisfies the fundamental identity

$$
\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=p_1^{\alpha_1}\cdots p_r^{\alpha_r}.
$$

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

$$
p_1,\ldots,p_r.
$$

If the subset has size $k$, its contribution is

$$
(-1)^k.
$$

Therefore

$$
\sum_{d\mid n}\mu(d) =
\sum_{k=0}^{r} \binom{r}{k}(-1)^k =
(1-1)^r.
$$

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

## The Inversion Role

The identity

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

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

If

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

then the Möbius function allows one to recover $f$ from $F$. The formula is

$$
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 $a$ and $b$,

$$
\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

$$
\sum_{d\mid a,\ d\mid b}\mu(d)
$$

acts as an indicator for the condition

$$
\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 $n$ is squarefree if and only if

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

If $n$ is not squarefree, then

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

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

For example,

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

while

$$
\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 $1$, $-1$, and $0$, 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 $\mu(n)$. This makes the Möbius function a bridge between prime factorization and summation over divisors.

