TITLE: Sum of the inverses of numbers with $n$ divisors.
QUESTION [5 upvotes]: Let $d(n)$ be the number of divisors of a natural number $n$. Define $S(n)$ as the sum
$$\sum_{d(k)=n}\frac1k$$
We know that $S(1)=1$, $S(2)$ diverges because is the sum of the inverses of the primes and
$$S(3)=\sum_{d(k)=3}\frac1k<\sum_{j=1}^\infty\frac1{j^2}$$
so $S(3)$ converges.
It is known for what values of $n$ does $S(n)$ converge?
EDIT: 
If $n$ is odd, then, since only perfect squares has an odd number of divisors,
$$S(n)<\sum_{j=1}\frac1{j^2}$$
I suspect that the sum diverges if $n$ is even.

REPLY [5 votes]: It converges iff $n$ is odd. If $d(k)$ is odd, then $k$ is a square,
and the sum is $<\sum1/r^2$.
If $n=2m$, take any number $s$ with $d(s)=m$. Then for all but finitely
many primes $p$, $d(ps)=n$. So we get the sum $\ge \sum_{p>p_0}1/(ps)$
which diverges.