For some purposes I have been checking whether or not there were many numbers around 600000 with exactly 12 divisors. I have been struck by the fact that more than 10% of the numbers near 600000 (by less than 10000) have exactly 12 divisors. I know the divisor function $\tau(n)$ is really small, but I do not understand the distribution of the numbers such that $\tau(n)=k$ fixed. So:
What do we know about the set of numbers $n$ such that $\tau(n)=k$?
I would like to know if the situation above is exceptional or if it is that previsible by some analytic number theory. Maybe is it possible to address the following question:
Let $n \in \mathbb{N}$, $\delta < n$, and $k \in \mathbb{N}$. Is it possible to estimate the natural density $$\frac{\#\{n - \delta \leqslant m \leqslant n + \delta \ : \ \tau(m) = k \}}{2\delta} ?$$
The equation $\tau(n)=k$ for fixed positive integer $k$ has always infinitely many solutions, because $n=p^{k-1}$ is a solution to $\tau(n)=k$ for all primes $p$. But there are infinitely many primes. So in this respect $k=12$ is not special. Concerning density it depends on the definition (of density we want to consider).