Sum of divisor function over arithmetic progression 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?
 A: 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$.
A: Werner Georg Nowak, ON A RESULT OF SMITH AND SUBBARAO CONCERNING A DIVISOR PROBLEM
Canad. Math. Bull. Vol. 27 (4), 1984.
Werner considers a different problem. He investigates  the number of (positive) divisors of the positive integer n which are congruent to l modulo k. I.e. d(n;l,k) = #{d : d|n & d ≡ l(k)}.
