I want to estimate the number of number with $k$ divisors up to $n$, $\mathcal{D}_k(n)$. I am mostly interested in estimating $\mathcal{D}_k(n)$.
We will also find the "$k$-prime" counting functions $\pi_k(n)$ which count the number of numbers up to $n$ with exactly $k$ prime divisors (counting multiplicity, eg $4$ is a $2$-prime).
Let's look at a couple simpler examples.
$\mathcal{D}_2(n)$ is just the standard prime counting function $\pi(n)$.
$\mathcal{D}_4(n)$ counts how many numbers up to $n$ have exactly $4$ divisors. By investigating the definition of the divisor counting function, we can find that all such numbers must have the form $p^3$ or $pq$ where $p$ and $q$ are distinct primes. Thus we can rewrite $$\mathcal{D}_4(n) = \pi(\sqrt[3]{n}) + \pi_2(n) - \pi(\sqrt{n})$$
The $k$-prime counting functions are nice because they have well known asymptotic forms, for example see this paper.
OEIS also has some sequences related to $\mathcal{D}_4(n)$, for example A035533.
Unfortunately I can't see how to expand $\mathcal{D}_8(n)$ in terms of $\pi_k$ or otherwise approximate it.
Why? Consider the possible forms of numbers which have exactly $8$ divisors: $pqr$, $p^7$, and $pq^3$, where $p$, $q$, and $r$ are distinct primes.
We can count the second kind pretty easily, ie $\pi(\sqrt[7]{n})$. But the other two are more difficult: we can start approximating the number of numbers of the form $pqr$ with $\pi_3(n) - \pi(\sqrt[3]{n})$, but $\pi_3(n)$ includes numbers of the form $pq^2$ which $\pi(\sqrt[3]{n})$ does not remove, so this is imperfect.
This problem is even worse for the third kind of number ($pq^3$).
We can use a sum, like
$$ \mathcal{D}_8(n) = \pi(\sqrt[7]{n}) + \frac{1}{3}\sum_{p \le n}\pi_2(\frac{n}{p}) - \frac{1}{3}\sum_{p \le n}\pi(\sqrt{\frac{n}{p}}) - \frac{2}{3}\pi(\sqrt[3]{n}) + \sum_{p \le n}\pi(\sqrt[3]{\frac{n}{p}}) - \pi_4(n)$$
(not verified - I may have flubbed this)
But I do not know how to asymptotically approximate this. My best guess is replacing the sums with integrals and then replacing $\pi(n)$ with $\int_{0}^{n}\frac{dx}{\log{x}}$ (or a better approximation).
Is there a known asymptotic expansion for the function
$\mathcal{D}_8(n)$
similar to the approximations for $\pi_k(n)$ in the paper I linked? Or is it possible to derive one that's at least good enough that $\lim_{n\to\infty}\frac{\mathcal{D}_8(n)}{\tilde{\mathcal{D}_8}(n)}$?