$\DeclareMathOperator\gcd{gcd}$Take $q\in \mathbb N$ and $X>0$ ($q$ not necessarily smaller than $X$). A sum such as $$\sum_{d\leq X}(q,d)$$ is easily seen to be $\ll q^\epsilon (X+q)$ so that the gcd doesn't make the sum much larger than how it would be without it — the values for which $(q,d)$ are significant are rare.

If I have instead a sum like $$\sum_{dd'\leq X}(q,d+d')$$ can I still conclude a similar bound, thinking that the $d+d'$ should give just as "random values" to $(q,d+d')$ as did $d$ to $(q,d)$? Or is this completely the wrong way to think about it?

It's of course similar to asking about $$\sum_{\substack{dd'\leq X\\q\mid d+d'}}1$$ which seems easy enough but I'm still a bit unsure… is this even $\ll (qX)^\epsilon (X/q+1)$?

3more comments