Is it possible to get a good upper bound for $$\sum\_{1\leq |h|\leq q}\frac{c\_{q}(a-h)}{h}$$ with $(a,q)=1$ and $1\leq a\leq q$.



Ramanujan's type sum
If I'm not mistaken, the $h>0$ part of the sum is
\[ \sum \_{d|q}d\mu (q/d)\sum \_{h\leq q\atop {h\equiv a(d)}}\frac {1}{h}\]
and here the inner sum is
\[ \sum \_{0\leq h\leq (q-a)/d}\frac {1}{hd+a}\leq \frac {\log q}{d}+\frac {1}{a}\]
so that the whole sum is
\[ \leq \sum \_{d|q}d\left (\frac {\log q}{d}+\frac {1}{a}\right )\ll q^\epsilon +\frac {q}{a},\]
whilst for prime $q$ the ($h>0$ part of the) sum is literally
\[ -\sum \_{h\leq q\atop {h\not =a}}\frac {1}{h}+\frac {p-1}{a}\ll \log q+\frac {p}{a}.\]
What kind of bound were you expecting/hoping for?


