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.
 A: 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$.
A: The number of divisors of $p^a$ is $a+1$, that of $p^aq^b$ is $(a+1)(b+1)$, that of $p^aq^br^c$ is $(a+1)(b+1)(c+1)$ (with $p,q,r$ distinct primes and $a,b,c\in\mathbb N$) and so on  for more prime divisors.
Since $15$ cannot be written as a product with more than two nontrivial factors, we need only look for numbers of the form $p^{14}$ or $p^2q^4$.
A: Hint: Every number has a unique prime factorization. If $N = p_1^{e_1}p_2^{e_2} \ldots p_n^{e_n}$, where the $p_i$ are distinct primes, then the number of divisors of $N$ is $(e_1+1)(e_2+1)\ldots(e_n+1)$ (Why?). Now 15 can only be written (nontrivially) as $3 \times 5$, thus $N$ must be of the form $p_1^2p_2^4$. Now we need to count the number of such products that is less than 20000.
EDIT: Also, of course, the form $p_1^{14}$ as Hagen pointed out
