I am trying to find an estimate for the following sum:


$$
\sum\_{\substack{n \leq x \\ n \equiv k (m)}} d(n),
$$


where $d(n)$ is number of divisors of $n$. I found estimates for the case when $k$ and $m$ are coprime, but nothing explicit for general case. My expectation for this sum is that this should be known, but I can't find anything. Any ideas/references?



Sum of divisor function over arithmetic progression
In the context of the "divisor problem for arithmetical progressions",
there is the following article by Fouvry, Iwaniec and Katz, on "The divisor function over arithmetic progressions": <http://matwbn.icm.edu.pl/ksiazki/aa/aa61/aa6134.pdf>.
The authors use Fourier series techniques
and Weil’s estimate for Kloosterman sums to obtain 
$$
S(x,m,k)-D(x,m)=\sum\_{n\le x, n\equiv k(m)}d(n)-\frac{1}{\phi(m)}\sum\_{n\le x,(n,m)=1}d(n)=O((m^{1/2}+x^{1/3})x^{\epsilon}).
$$
We have the estimate 
$$
\phi(m)D(x,m)=\sum\_{n\le x,(n,m)=1}d(n)=xP(\log x)+O(x^{1/2}m^{\epsilon}),
$$
with $P(\log x)=\frac{\phi(m)^2}{m^2}(\log x+\gamma-1)+2\frac{\phi(m)}{m}\sum\_{d\mid m}\frac{\mu(d)\log d}{d}$.


Werner Georg Nowak proved in $1984$ that for any given natural numbers $m$ and $k$,
$$
S(x,m,k)=\alpha x(\log x+2\gamma -1)+\beta x+ O(x^{35/108+\epsilon}),
$$
for constants $\alpha$ and $\beta$ depending only on $m$ and $k$.


