Prove $\sum_{d|n} \frac{\Phi(d)}{d} = \prod_{i=1}^r (1 + a_i - \frac{a_i}{p_i})$ I want to prove $\sum_{d|n} \frac{\Phi(d)}{d} = \prod_{i=1}^r (1 + a_i(1 - \frac{1}{p_i}))$, where $\Phi(n)$ is the Euler phi function and given the prime factorisation $n = \prod_{i=1}^r p_i^{a_i} $.
My instinct says to use the Möbius inversion formula, but I am struggling to identify the functions $f(n)$ and $g(n)$ that will allow me to prove this. Any insight would be appreciated.

Observe that with your factorization we get for example
$$\sum_{d|n} d =
\prod_{q=1}^r (1+p_q+p_q^2+\cdots+p_q^{a_q})$$
Now we have with the product ranging over prime divisors that
$$\frac{\varphi(d)}{d} = \prod_{p|d} \left(1-\frac{1}{p}\right).$$
Using the same scheme again we thus obtain
$$\sum_{d|n} \frac{\varphi(d)}{d} =
\prod_{q=1}^r
\left(1 + \left(1-\frac{1}{p_q}\right) +
\left(1-\frac{1}{p_q}\right) +  \cdots
+ \left(1-\frac{1}{p_q}\right) \right)$$
where the sum contains $a_q$ terms. This yields
$$\prod_{q=1}^r
\left(1 + a_q \left(1-\frac{1}{p_q}\right)\right)$$
which  is the  claim.  Here  we use  the fact  that $\varphi(d)/d$  is
multiplicative   and   so  is   $\alpha\star   1$   with  $\alpha$   a
multiplicative function as pointed out by M. Cohen.
