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 Moebius 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

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

That is,


 * $\mu * u = \iota$

where $u$ and $\iota$ are the Unit Arithmetic Function and Identity Arithmetic Function respectively.

Proof of Lemma
The lemma is clearly true if $n=1$.

Assume, then, that $n > 1$ and write, by the fundamental theorem of arithmetic:
 * $n = p_1^{a_1} p_2^{a_2} \dots p_k^{a_k}$

In the sum $\displaystyle \sum_{d \mathop \backslash n} \mu \left({d}\right)$ the only non-zero terms come from $d=1$ and the divisors of n which are products of distinct primes.

Thus from Alternating Sum and Difference of Binomial Coefficients for Given n:

Hence, the sum is $1$ for $n=1$, and $0$ for $n>1$, which are precisely the values of $\displaystyle \left \lfloor {\frac 1 n} \right \rfloor$.

Proof of Theorem
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 \leq k \leq n$ which are multiples of $d$.

If we write $k = q d$, then $1 \leq k \leq n$ if and only if $1 \leq q \leq \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$