Question:
Given positive integers $p$, $q$ and $r$ with $p=3^q\cdot2^r$ and $100<p<1000$. The difference between maximum and minimum values of $(q+r)$, is _______.
My Approach:
As we are given that $100<p<1000$, on taking logarithm to the base $10$, we get:
$$\log100<\log p<\log 1000$$
$$2<\log(3^q\cdot2^r)<3$$
$$2<q\log 3+r\log 2<3$$
$$2<q(0.4771)+r(0.3010)<3$$
The only way I could think of to obtain the maximum and minimum values of $q$ and $r$ is to substitute them with natural numbers and look when the condition is satisfied. Is there any formal approach (other than substituting $q$ and $r$ with natural numbers) using which we can find the minimum and maximum values of $(q+r)$? If yes, it would be helpful if you could explain it.
On substituting different values of $q$ and $r$ in the condition arrived, the minimum and maximum values of $(q+r)$ comes out to be $5$ and $9$ respectively. And the answer to the above question is thus $9-5=4$. This is also the correct answer with respect to the answer key provided in my book.