Sum of Möbius Function over Divisors

Theorem
Let $n \in \Z_{>0}$ be a strictly positive integer.

Then:


 * $\displaystyle \sum_{d \mathop \backslash n} \mu \left({d}\right) \frac n d = \phi \left({n}\right)$

where:


 * $\displaystyle \sum_{d \mathop \backslash n}$ denotes the sum over all of the divisors of $n$


 * $\phi \left({n}\right)$ is the Euler $\phi$ function, the number of integers less than $n$ that are prime to $n$


 * $\mu \left({d}\right)$ is the Möbius function.

Equivalently, this says that:


 * $\phi = \mu * I_{\Z_{>0} }$

where:
 * $*$ denotes Dirichlet convolution
 * $I_{\Z_{>0} }$ denotes the identity mapping on $\Z_{>0}$, that is::
 * $\forall n \in \Z_{>0}: I_{\Z_{>0} }: n \mapsto n$.

Lemma
Let $1 \left({k}\right) = 1$ be the constant mapping.

Then $\phi$ is defined as:
 * $\displaystyle \phi \left({n}\right) = \sum_{k \mathop \perp n} 1 \left({k}\right)$

We have that $\gcd \left({n, k}\right)$ is $1$ if $k \perp n$ and $0$ otherwise.

Thus we can rewrite the above sum as:
 * $\displaystyle \sum_{k \mathop = 1}^n \left \lfloor {\frac 1 {\gcd \left({n, k}\right)}} \right \rfloor$

Now we may use the lemma, with $\gcd \left({n, k}\right)$ replacing $n$, to get:

$\displaystyle \phi \left({n}\right) = \sum_{k \mathop = 1}^n \left({\sum_{d \mathop \backslash \gcd \left({n, k}\right)} \mu \left({d}\right)}\right)$

$= \sum_{k \mathop = 1}^n \sum_{\binom {d \mathop \backslash n} {d \mathop \backslash k} } \mu \left({d}\right)$

For a fixed divisor $d$ of $n$, we must sum over all those $k$ in the range $1 \le k \le n$ which are multiples of $d$.

If we write $k = q d$, then $1 \le k \le n$ $1 \le q \le \dfrac n d$.

Hence the last sum for $\phi \left({n}\right)$ can be written as: