TITLE: Find all numbers such that "Product of all divisors=cube of number".
QUESTION [9 upvotes]: While solving some old olympiad problems I came across this one. As I m stuck at it, so I m here.
The problem is: Find all positive integers $N$ such that the product of all the positive divisors of N is equal to $N^3$.
Since I was not able to solve this one mathematically hence I tried Hit and trial method to find the pattern and then work upon it. I got that:
12 has divisors 1,2,3,4,6,12 product of all of which give 1728($12^3$).Similarly 18,20,28 also follow the same case. I noticed that all of them have 4 factors, but I don't think it can take me any further (I also think that a perfect power(such as $2^3$)will not follow the case).
After all of  my efforts I m on U guys. Need help. Any Mathematical formulation or suggestion is heartily welcome. Thanks.

REPLY [3 votes]: If
$$
n=\prod_ip_i^{e_i}
$$
and
$$
E=\prod_i(e_i+1)
$$
then the number of factors of $p_i$ in the product is $\frac{e_i^2+e_i}2\prod\limits_{j\ne i}(e_j+1)=\frac{e_i^2+e_i}2\frac{E}{e_i+1}=Ee_i/2$.
Thus, the product of all the divisors is
$$
\prod_ip_i^{Ee_i/2}
$$
So we need $E=6$ or all the $e_i=0$.
Thus, the number is either $1$, a prime to the fifth power, or the product of two primes, one to the first power and the other to the second power.

Examples
$2^5=32$: $1\cdot2\cdot4\cdot8\cdot16\cdot32=32768=32^3$
$2^2\cdot3=12$: $1\cdot2\cdot3\cdot4\cdot6\cdot12=1728=12^3$