TITLE: P is a natural number. 2P has 28 divisors and 3P has 30 divisors. How many divisors of 6P will be there?
QUESTION [7 upvotes]: While answering Aptitude questions in a book I faced this question but not able to find the solution So I searched Google and got two answers but didn't get an idea how the answer came. 
Question: 
P is a natural number. 2P has 28 divisors and 3P has 30 divisors. How many divisors of 6P will be there?
Solution 1:
2P is having 28(4*7) divisors but 3P is not having a total divisors which is divisible by 7, so the first part of the number P will be 2^5.
Similarly, 3P is having 30 (3*10) divisors but 2P does not have a total divisors which is divisible by 3. So 2nd part of the number P will be 3^3. So, P = 2^5*3^3 and the solution is 35.
Solution 2:
2P has 28 divisors =4x7,
3P has 30 divisors 
Hence P=2^5 3^3
6p =2^6 3^4
Hence 35 divisors 
I have been trying to understand the steps but not able to get.

REPLY [4 votes]: First, we want to know how to easily calculate the number of divisors of any number. If we have $n=p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}$ where all $p_i$ are distinct, then to construct a divisor we have $e_1+1$ choices for the number of factors $p_1$ in our divisor, $e_2+1$ choices for the number of factors $p_2$, etc., making the number of divisors equal to $(e_1+1)(e_2+1)\cdots (e_k+1)$. So for example, $12=2^2\cdot 3$ so $12$ has $(2+1)(1+1)=6$ divisors.
Let's look at the first hint now, $2P$ having 28 divisors. Let's write $2P=p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}$. The number of divisors is now $(e_1+1)(e_2+1)\cdots (e_k+1)=28$. So, we can say that one power, say $e_1$, must be either $6,13$ or $27$ (since 28 has a factor 7, and we assumed it was contained in $e_1+1$. Our options are now:
$$2P=p_1^6\cdot p_2\cdot p_3$$
$$2P=p_1^6\cdot p_2^3$$
$$2P=p_1^{13}\cdot p_2$$
$$2P=p_1^{27}$$
The second hint says that 3P has 30 divisors. Since this does not contain a factor 7, we know that the $2$ in $2P$ must be responsible for this (notice that follows $e_1$ is the power of 2 in $2P$). Thus we know that $p_1=2$. Now we can, by our previously stated options, calculate P.
$$P=2^5\cdot p_2\cdot p_3$$
$$P=2^5\cdot p_2^3$$
$$P=2^{12}\cdot p_2$$
$$P=2^{26}$$
In the third option, the number of divisors of $3P$ must be divisible by $12+1=13$, and in the last case, the number of divisors of $3P$ must be divisible by $27$. We conclude the last two are not possible, since 30 is not divisible by either 13 or 27. In the first case, the number of divisors of $3P$ is divisible by $6$ because of the amount of factors 2, and we also know that $3P$ there has (at least) one prime factor that it only contains one time, so we have another factor 2 in the number of divisors of $3P$. Now the number of divisors of $3P$ is divisible by $12$, which is also impossible ($12$ does not divide $30$). We conclude that $P$ must be of the form $p_1^5\cdot p_2^3$. We also know that if $p_2\neq 3$, then the number of divisors of $3P$ is divisible by $6$ because of the factors 2 and by $4$ because of the factors $p_2$. This is again impossible.
Finally, we must have $p_2=3$ so $P=2^5\cdot 3^3$. Now we can easily calculate the number of divisors of $6P$; it must be $(6+1)(4+1)=35$.
Hope this helped!