Estimate for a specific series For a positive integer $m$ define
$$
a_m=\prod_{p\mid m}(1-p),
$$
where the product is taken over all prime divisors of $m$, and
$$
S_n=\sum_{m=1}^n a_n.
$$
I am interested in an estimate for $|S_n|$. Any references, hints, ideas, etc., will be appreciated.
 A: As Oussama Boussif notice, using the Euler product for the totient function $$\phi\left(m\right)=m\prod_{p\mid m}\left(1-\frac{1}{p}\right)
 $$ we have $$a_{m}=\prod_{p\mid m}\left(1-p\right)=\left(-1\right)^{\omega\left(m\right)}\frac{\phi\left(m\right)}{m}\prod_{p\mid m}p
 $$ where $\omega\left(m\right)
 $ is the number of distinct prime factors of $m
 $, so we have using the fact that $\prod_{p\mid m}p\leq m
 $ (equality holds if $m
 $ is a squarefree number) $$\left|\sum_{m=1}^{n}a_{m}\right|\leq\sum_{m=1}^{n}\phi\left(m\right)=\frac{3}{\pi^{2}}n^{2}+O\left(n\log\left(n\right)\right).
 $$ 
A: Let $a_n = \prod_{p \mid n} (1 - p)$. As $a_n$ is a multiplicative function, we have that
\[\sum_{n = 1}^{\infty} \frac{a_n}{n^s} = \prod_p \left(1 + \sum_{k = 1}^{\infty} \frac{(1 - p)}{p^{ks}}\right) = \prod_p \left(1 + \frac{1 -p}{p^s(1 - p^{-s})}\right) = \prod_p \left(\frac{1 - p^{-(s - 1)}}{1 - p^{-s}}\right).\]
So
\[\sum_{n = 1}^{\infty} \frac{a_n}{n^s} = \frac{\zeta(s)}{\zeta(s - 1)}.\]
The right-hand side defines a meromorphic function on $\mathbb{C}$, and by the standard zero-free region for $\zeta(s)$, it has no poles in the region $\Re(s) > 2 - 1/\log(|\Im(s)| + 2)$. Using this and the same sort of methods used to prove the prime number theorem, one can therefore show that
\[\sum_{n \leq x} a_n = O\left(x^2 e^{-c\sqrt{\log x}}\right).\]
Assuming the Riemann hypothesis, this can be strengthened to
\[\sum_{n \leq x} a_n = O_{\varepsilon}\left(x^{3/2 + \varepsilon}\right).\]
One can probably also prove this by first showing that
\[a_n = \sum_{d \mid n} d\mu(d),\]
and then estimating $\sum_{n \leq x} a_n$ and using the fact that $\sum_{n \leq x} \mu(n) = O(xe^{-c\sqrt{\log x}})$ by the prime number theorem.
