How can we find an asymptotic formula for $$\sum_{\substack{1\leq k\leq n \\ (n,k)=1}}f(k)?$$ Here $f$ is some function and $(n,k)$ is the gcd of $k$ and $n$. I am particularily interested in the case $$\sum_{\substack{1\leq k\leq n \\ (n,k)=1}}\frac{1}{k}.$$ I know about the result $$\sum_{\substack{1\le k\le n\\(n,k)=1}}k=\frac{n\varphi(n)}{2}$$ which was discussed here, but I don't know if I can use it in the case of $f(k)=1/k$.
2026-04-29 12:21:36.1777465296
Asymptotics for sums of the form $\sum \limits_{\substack{1\leq k\leq n \\ (n,k)=1}}f(k)$
346 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
Hint: Try using the fact that $\sum_{d|n} \mu(d)$ is an indicator function for when $n=1$. This allows us to do the following for any function $f$:
$$\sum_{n\leq x}\sum_{k\leq n,\ \gcd (k,n)=1} f(k,n)=\sum_{n\leq x}\sum_{k\leq n} f(k,n) \sum_{d|k, \ d|n} \mu (d) =\sum_{d\leq x} \mu(d) \sum_{n\leq \frac{x}{d}}\sum_{k\leq n} f(dk,nk).$$
This method is very general, and works in a surprisingly large number of situations. I encourage you to try it.
Remark: Using this approach I get $$\sum_{n\leq x}\sum_{k\leq n,\ \gcd(k,n)=1} \frac{1}{k}=\frac{6x}{\pi^{2}}\log x+\left(-\frac{\zeta^{'}(2)}{\zeta(2)^2}+\frac{6\left(\gamma-1\right)}{\pi^{2}}\right)x+O\left(\log^{2}x\right).$$
Edit: I made a slight miscalculation in my remark, missing the factor of $\zeta(2)^2$ in the $\zeta^{'}(2)$ term, and have updated the asymptotic.