Best error term in $\sum_{(n,q)=1}\frac{1}{n}$ (harmonic series with coprimality condition)

69 Views Asked by At

It is very well known and not difficult to prove that

$\displaystyle\sum_{\substack{0<n\leq X\\ \\(n,q)=1}}\frac{1}{n}=\left(\log(X)+\gamma+\sum_{p|q}\frac{\log(p)}{p-1}\right)\frac{\phi(q)}{q}+O\left(\frac{2^{\omega(q)}}{X}\right)$.

Moreover, from the above expression, we obtain that

$\displaystyle\sum_{\substack{0<n\leq X\\ \\(n,q)=1}}\frac{1}{n}\ \sim\ \left(\log(X)+\gamma+\sum_{p|q}\frac{\log(p)}{p-1}\right)\frac{\phi(q)}{q}$

On the other hand, for $q=1$, we can obtain an optimal and explicit error term, for example, thanks to the Euler-Maclaurin summation formula, given by $O^*\left(\frac{1}{2X}\right)$ (we can obtain many lower order terms by using this, too). Inspired by this, the above error term $O\left(\frac{2^{\omega(q)}}{q}\right)$ looks like improvable, at least explicitly (i.e. with better constants, in $O^*$ notation, say), if not in order.

The question is which would be the best known bound, with optimal constants, and why, for the following expressions

$\star:\ \displaystyle\left|\sum_{\substack{0<n\leq X\\ \\(n,q)=1}}\frac{1}{n}-\left(\log(X)+\gamma+\sum_{p|q}\frac{\log(p)}{p-1}\right)\frac{\phi(q)}{q}\right|$,

and in general, for $X_1\neq 0$,

$\star\star:\ \displaystyle\left|\sum_{\substack{X_1<n\leq X_2\\ \\(n,q)=1}}\frac{1}{n}-\frac{\phi(q)}{q}\log\left(\frac{X_2}{X_1}\right)\right|$?

And related, is there an explicit asymptotic formula involving many lower order terms?

I haven't found any good explanation for this matter in the literature, so your help would be really appreciated. Thanks!