Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone help me prove the relation

$\varphi\left(n\right)={\displaystyle \sum_{d|n}}d\mu\left(n/d\right)$, where $\mu$ is the Möbius function defined by $$ \mu\left(n\right)=\begin{cases} 1 & \mbox{if }n=1\\ \left(-1\right)^{t} & \mbox{if }n\mbox{ is a product of }t\mbox{ distinct primes}\\ 0 & \mbox{if }p^{2}\mbox{ divides }n\mbox{ for some prime }p. \end{cases} $$

share|cite|improve this question

This follows from the identity $\sum_{d\mid n}\mu (d)=\lfloor \frac{1}{n}\rfloor$. Indeed, denoting the greatest common divisor of $n$ and $k$ by $(n,k)$, we have \begin{align*} \phi(n) & = \sum_{k=1}^n \left\lfloor \frac{1}{(n,k)} \right\rfloor = \sum_{k=1}^n \sum_{d\mid (n,k)} \mu(d) = \sum_{k=1}^n \sum_{\substack{d\mid n\\ d\mid k}}\mu(d) \\ & = \sum_{d\mid n}\sum_{q=1}^{n/d}\mu(d)=\sum_{d\mid n}\mu(d)\Biggl( \sum_{q=1}^{n/d}1\Biggr) = \sum_{d\mid n}\mu(d)\frac{n}{d}=\sum_{d\mid n}d\mu \left(\frac{n}{d}\right). \end{align*}

share|cite|improve this answer

Hint: $$\varphi(p_1^{m_1}p_2^{m_2}\ldots p_k^{m_k}) = p_1^{m_1}p_2^{m_2}\ldots p_k^{m_k} \prod_{i=1}^k \left( 1 - \frac{1}{p_k}\right)$$ and $d \mid n$ iff $d=p_1^{r_1}p_2^{r_2}\ldots p_k^{r_k}$ for $0 \le r_i \le m_i$.

share|cite|improve this answer

$$ \forall n \geq 1 , g(n) = \sum_{d \mid n} f(d) \Rightarrow f(n) = \sum_{d \mid n} \mu(d) g \left(\frac{n}{d} \right) $$

$$ n = \sum_{d \mid n}\varphi(d) \Rightarrow \varphi(n) = \sum_{d \mid n} \frac{n\mu(d)}{d} = \sum_{d \mid n} d\mu \left( \frac{n}{d} \right) $$

proof of Möbius inversion formula is here

share|cite|improve this answer

Alternatively, you can note that $n = \phi \ast u$ where $u = 1$ for all n, and $\ast$ denotes the Dirichlet product, and use the Mobius inversion formula, so

$n = \phi \ast u\\ n \ast \mu = \phi \ast u \ast \mu = \phi \ast I = \phi$

where $I$ is the identity function, and so

$\phi = n \ast \mu = \sum_{d|n} d \, \mu \left( \frac{n}{d} \right)$

by definition of the Dirichlet convolution.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.