Integers with 15 divisors (from brilliant.org) How many integers from 1 to 19999 have exactly 15 divisors?
Note: This is a past question from brilliant.org.

If $n = p_1^{a_1}p_2^{a_2} \ldots p_k^{a_k}$, then the number of divisors is given by $d(n) = (1+a_1)(1+a_2)\cdots(1+a_k)$. We are given that $d(n) = 15$. From this, show that there cannot be $3$ distinct primes diving $n$. Hence, $n=p_1^{a_1}$ or $n=p_1^{a_1} p_2^{a_2}$.
$1$. If $n=p_1^{a_1}$, then $(1+a_1) = 15 \implies a_1 = 14$. And since $n \leq 19999$, we have $p_1=2$.
$2$. If $n=p_1^{a_1}p_2^{a_2}$, (assume $a_1 \geq a_2$) then $(1+a_1)(1+a_2) = 15$ gives us $$a_1 = 4,a_2 = 2$$
$a_1 = 4$, then $p_1 \in \{2,3,5,7\}$, since $13^4 > 20000$ and $11^4 > \dfrac{20000}{2^2}$.


*

*$a_1 = 4$, $p_1=2$ gives us $p_2 \neq 2$ and $p_2^2 < \dfrac{20000}{2^4} \implies p_2 \leq 31$. Hence, number of options is $10$.

*$a_1 = 4$, $p_1=3$ gives us $p_2 \neq 3$ and $p_2^2 < \dfrac{20000}{3^4} \implies p_2 \leq 13$. Hence, number of options is $5$.

*$a_1 = 4$, $p_1=5$ gives us $p_2 \neq 5$ and $p_2^2 < \dfrac{20000}{5^4} \implies p_2 \leq 5$. Hence, number of options is $2$.

*$a_1 = 4$, $p_1=7$ gives us $p_2 \neq 7$ and $p_2^2 < \dfrac{20000}{7^4} \implies p_2 \leq 2$. Hence, number of options is $1$.


Hence, if $n$ has only one distinct prime divisor, then there is only one $n$ and if $n$ has two distinct prime divisor, then there are $10+5+2+1 = 18$ such $n$'s. Hence, the total number of $n$'s less than $20000$, with $15$ divisors is $19$.
