Distribution of random divisor sums modulo n Let $k$, $n\ge 2$ be positive integers, and choose $\ell$ such that $0\le \ell \le k-1$. For each integer $2\le j \le n$, choose a divisor $d_j$ of $j$, uniformly at random from the divisors of $j$. Prove if $P(n,k,\ell)$ denotes the probability $$d_2 + d_3 + \cdots + d_n \equiv \ell \pmod{k}$$ then $$\lim_{n\to\infty} P(n,k,\ell) = \frac{1}{k}$$
I am able to show this for $k$ a prime or power of two, but I am not sure how to do so for other values of $k$. When $k$ is a power of two, in fact $P(n,k,\ell) = 1/k$ for sufficiently large $n$, and when $k = p$ is prime, we have $$|P(n,p,\ell) - 1/p| \le \frac{p+1}{p(p-1)^{J(n)}}$$ where $J(n)$ is the largest integer such that ${a_{J(n)}}^{p-2} \le n$, where $a_k$ is the $k$th prime number that is also a primitive root mod $p$.
 A: Assuming that the question intends the divisors $d_j$ to be chosen independently of each other (for $2\le j\le n$), we can show that the desired probability converges rapidly to $1/k$.  To see this, recall that 
$$ 
\frac{1}{k} \sum_{a \, (\text{mod} \,k)} e^{-2\pi i \ell a/k} e^{2\pi i a d/k} = 
\begin{cases} 1 & \text{if } d\equiv \ell\text{ }(\text{mod }k)\\ 
 0 &\text{otherwise}.
\end{cases}
$$ 
Therefore, the desired probability is 
$$ 
\frac{1}{k} \sum_{a\, (\text{mod} \,k)} e^{-2\pi i \ell a/k}\, {\Bbb E}\left(\prod_{j=2}^{n} e^{2\pi i d_j a/k}\right)= \frac{1}{k} \sum_{a\, (\text{mod} \,k)} e^{-2\pi i\ell a/k} \prod_{j=2}^{n} {\Bbb E}(e^{2\pi i ad_j/k}).
$$ 
The term $a\equiv 0\text{ }(\text{mod }k)$ gives the stated main term $1/k$.  
Consider now the contribution of terms with $a\not\equiv 0\text{ }(\text{mod }k)$.  Clearly for every $j$, we have $|{\Bbb E}(e^{2\pi i a d_j/k})| \le 1$.  Using this trivial bound for all composite $j$, we see that 
$$ 
\left| \prod_{j=2}^{n} {\Bbb E}(e^{2\pi i ad_j/k}) \right| 
\le \prod_{p\le n} \left| \frac{1+e^{2\pi i ap/k}}{2}\right| = 
\prod_{p\le n} \left|\cos (\pi a p/k)\right|. 
$$
Since the primes are evenly distributed in reduced residue classes mod $k$ (this is a consequence of the proof of Dirichlet's Theorem), we have that 
$$ 
\prod_{p\le n} \left|\cos (\pi a p/k)\right| \le \left( \prod_{b=1,\,(b,k)=1}^k \left|\cos (\pi ab/k)\right| \right)^{\frac{1+o(1)}{\varphi(k)} \frac{n}{\log n} } < c_k^{\frac{n}{\log n}}, 
$$
for some easily determined constant $c_k$ which is strictly less than $1$.  
This completes the proof that the probability converges essentially exponentially rapidly to $1/k$. We can probably be a lot more precise by not ignoring the typical composite numbers as above. 
