What I'm missing in $p=3^{q}\cdot 2^{r}$? Given positive integer $p,q,r$ with $p=3^{q}\cdot 2^{r}$ and $100&lt;p&lt;1000$. The difference between maximum and minimum values of $(q+r)$ is?


My tries

It's clear that $p=6k$ for some positive integer $k$

Hence, $6*17=102\neq 3^{q}\cdot 2^{r}$, on trying next one $6*18=108=3^3\cdot2^2$
.Hence min $(q+r)=5$

Similarly, $972=6*162=3^52^2$, max $(q+r)=7$

difference $=2$, but didn't matched with answer given.

please help.
You're finding the largest number of the form $2^p 3^q$, but that doesn't maximize $p+q$. As $2&lt;3$ getting at high exponent on $2$ makes a smaller number than getting a high exponent of $3$. Trying the powers of $2$, we quickly find that $256=2^8$ is the highest that we can multiply by three and stay below $1000$.

Similar considerations might be relevant to find $\min(p+q)$.

And note that I haven't in any way proved that you'll find the $\min/\max$ this way, that's left for you.
Yoou don'h have to take minimum and maximum values of $p$, but of $q+r$, which is the number of prime factors in the expanded notation. To minimize  $q+r$, we need larger factors appearing more. hence we search for numbers where $r=1$. For $162=2\cdot3^4$. Similarly, for maximum, $768=3\cdot2^8$. this gives difference 4