Sum of Möbius Function over Divisors

Theorem
Let $n \in \Z_{>0}$, i.e. let $n$ 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, n \ge 1: I_{\Z_{>0}}: n \mapsto n$.

Lemma
If $1(k) = 1$ is the unity function, then $\phi$ is defined as:
 * $\displaystyle \phi(n) = \sum_{k \mathop \perp n} 1(k)$

Since $\gcd(n,k)$ is $1$ if $k \perp n$ and $0$ otherwise, we can rewrite the above sum as:
 * $\displaystyle \sum_{k \mathop = 1}^n \left \lfloor {\frac{1}{\gcd(n,k)}} \right \rfloor$

Now we may use the lemma, with $\gcd(n,k) \ $ replacing $n$, to get:
 * $\displaystyle \phi(n) = \sum_{k \mathop = 1}^n \left({\sum_{d \mathop \backslash \gcd(n,k)} \mu(d)}\right) = \sum_{k \mathop = 1}^n \sum_{ { {d \mathop \backslash n} \choose {d \mathop \backslash k}}} \mu(d)$

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$ if and only if $1 \le q \le \dfrac n d$.

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


 * $\displaystyle \phi(n) = \sum_{d \mathop \backslash n} \left({\sum_{q \mathop = 1}^{\tfrac n d} \mu(d) }\right) = \sum_{d \mathop \backslash n} \mu(d) \sum_{q \mathop = 1}^{\tfrac n d} 1(q) = \sum_{d \mathop \backslash n} \mu(d)\dfrac n d$