To find the smallest integer with $n$ distinct divisors For example, if $n=20$, how can I find the smallest integer which has exactly $20$ distinct divisors?  Can someone give me some hints?
If $m=p_1^{a_1}p_2^{a_2}\ldots p_k^{a_k}$, we have number of divisors to be
$$(1+a_1)(1+a_2)\ldots(1+a_k)$$
For this to be $20$, we want
$$(1+a_1)(1+a_2)\ldots(1+a_k) = 20 = 2 \cdot 2 \cdot 5$$
This means $m$ can have at most $3$ distinct prime divisors.


$3$ prime divisors. The smallest possible $m$ is $2^4 \cdot 3 \cdot 5 = 240$.
$2$ prime divisors. The smallest possible $m$ is of the form $2^a \cdot 3^b$. This means we need $(1+a)(1+b) = 20$, where $a\geq b$.

$a=9,b=1$, gives $m=2^9 \cdot 3 = 1536$.
$a=4,b=3$, gives $m=2^4\cdot3^3 = 432$.

$1$ prime divisor. The smalles possible $m$ is of the form $2^{19} = 524288$.


Hence, the smallest $m$ is $240$.
Use $2^{20} $, it has divisors $1,2,2^2, 2^3,...,2^{19}$. If you want proper divisors, use $2^{21}$
Using a comment by Nicolas:

$ 1.2.2^2........2^{19}  \rightarrow  1.2.3.2^2..2^18 \rightarrow 1.2.3.5.2^2....2^{17} \rightarrow  1.2.3.5.7.2^2.....2^{16} \rightarrow 1.2.3^2.5.7.2^2.....2^{15} \rightarrow 1.2.3^{10}.5.7.2^2.2^3.....2^8 \rightarrow ....$