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<q\log 3+r\log 2<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.


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 _______.

The answer is quite straightforward if you draw the lines \begin{align*} \frac q{\frac 2{\log 3}}+\frac r{\frac 2{\log 2}}&=1\Rightarrow \frac q{4.\cdots}+\frac r{6.6\cdots}=1\tag{1}\\ \frac q{\frac 3{\log 3}}+\frac r{\frac 3{\log 2}}&=1\Rightarrow \frac q{6.\cdots}+\frac r{9.9\cdots}=1\tag{2}\\ q+r&=10\tag{3}\\ q+r&=4\tag{4}\\ \end{align*} on $q-r$ axes neatly and see that the points $(5,0)$ and $(0,9)$ can serve the best values $5$ and $9$ respectively, for the points lie strictly in the region between the lines $(1)$ and $(2)$ (let us call it region R). Lines $(3)$ and $(4)$ are drawn just to see that the best values can't be outside what we have obtained, that is $q+r$ can't be $4,10$.


But since $q,r\in \mathbb N$, we need to take positive integral points or points in which both $q,r\in\mathbb N$. I think the best approach would be to see that at least some segment of the lines $q+r=5$ and $q+r=9$ lies inside the region R, and then to make sure that those segments have positive integral points on them. For example, take the points $(4,1)$ and $(1,8)$. If they don't suffice(Well, they do here. I am just trying to provide an algorithmic approach to solve bigger such problems.), keep taking points from the segments of the lines $q+r=5$ and $q+r=9$. If they all don't suffice, move to lines that lie more inside the region R. For example, $q+r=4$ and $q+r=8$.

Note that the positive integral points nearest to the lines $(1)$ and $(2)$ will give the limits nearest to $100$ and $1000$. One can apply the "distance from a line" formula if the distances of two such points from the lines $(1)$ and $(2)$ are to be compared, and the inequality is not apparent by the neat plot.

  • $\begingroup$ Thank you for your answer. I like this approach. But how could we conclude that there exists a point between the two parallel lines in the first quadrant having positive integral coordinates, by just knowing $(5,0)$ and $(0,9)$ are solutions except the fact that one coordinate is zero? On plotting the lines, and with small calculations it becomes evident that $(4,1)$ and $(1,8)$ satisfy the condition. Or is there a better way to look at this? $\endgroup$ – Guru Vishnu Jul 15 '20 at 10:15
  • $\begingroup$ @mgv My bad! Actually, earlier I thought that $q,r\in \mathbb Z$ and not $\in \mathbb N$. So I will have to edit it. I think the best approach would be to see that some segments of the lines $x+y=5$ and $x+y=9$ lie inside the region strictly enclosed by the first two lines in the answer, and then to make sure that those segments have integral points on them, as you did by putting the values $(4,1)$ and $(1,8)$. If they don't suffice, keep taking values from the lines $x+y=5$ and $x+y=9$ and if they all don't suffice, go to lines that lie more inwards in the region, like $x+y=4$ and $x+y=8$. $\endgroup$ – Sameer Baheti Jul 15 '20 at 10:32
  • $\begingroup$ @mgv I have finished editing hopefully! Have a look. $\endgroup$ – Sameer Baheti Jul 15 '20 at 11:16

This is easiest to just reason directly.

For any $M$ that $2^M < 3^12^{M-1} < 3^22^{M-2} < ..... < 3^{M-1}2 < 3^M$.

So if $q+r = m$ and $100 < 3^q 2^r < 1000$ then

  1. $100 < 3^q2^r \le 3^{q+r}$ and
  2. $2^{q+r} \le 3^q2^r < 1000$

And as $3^4 < 100 < 3^5$ then minimum value that $q+r$ can be, by 1) is $5$. And as $2^9< 1000< 2^{10}$ the maximum value that $q+r$ can be, by 2) is $9$.

But this assumes that allows for $r$ or $q$ to be zero and the question specifically says positive. So we didn't actually do it right. But we can modify really easily.

  1. $100 < 3^q2^r \le 3^{q+r-1}\cdot 2 < 3^{q+r}$ and $3^4 < 100 < 81\cdot 2=3^4\cdot 2 < 3^5$.
  2. $2^{q+r} < 2^{q+r-1}\cdot 3 \le 3^q2^r < 1000$ and $256\cdot 3=2^8\cdot 3 < 2^9 < 1000 < 2^{10}$.

And our conclusions hold.


Note: Had the question been $80 < p < 1025$ we'd have had the same answers of a minimum of $4$ and a maximum of $9$ because, although $80< 3^4 < 2^{10} < 1025$ we are required that $r,q$ be non-zero and $3^3\cdot 2 < 80 < 2^10 < 3\cdot 2^9$.

Note 2: If we didn't have the requirement that $q,r$ but positive and allow them to be negative we would have no minimum or maximum.

For any negative $r$ then if $q= \lceil \log_3(101\cdot 2^{|r|})\rceil$ we will have $3^q2^r \ge 3^{\log_3(101\cdot 2^{|r|})}2^{r}=101\cdot 2^{r}2^{|r|}= 101$ and $3^q2^r < 3^{\log_3(101\cdot 2^{|r|})+1}2^{r}=3\cdot 101< 1000$.

And $\lim_{r\to -\infty} r+\lceil \log_3(101\cdot 2^{|r|})\rceil=$

$\lim_{r\to -\infty} r+ \log_3(101\cdot 2^{-r})=$

$\lim_{r\to -\infty} r-r\log_3 2 + \log_3(101)=$

$\lim_{r\to -\infty} r(1+\log_2 3) + \log_3(101)= -\infty$

so there is no minimum.

A similar argument for negative $q$ will show there is no maximum.


Observe that for the minimum value of $q+r$, we must have $2*3^{q}>100$ because $q,r>0$ and $2^r\leq3^q ,\forall r\leq q$ which means that multiplying by $3^q$ will get us to surpass $100$ the fastest, which requires the least amount of exponentiation. Solving for $q$ and taking the next integer that satisfies the inequality gives us $r+q=1+4=5$.

Then for the maximum, we need that $2^r*3 < 1000$ because multiplying by $2^r$ gets us to surpass $1000$ the slowest, which means the most amount of exponentiation. Solving for $r$ and taking the next integer that satisfies the inequality yields $r+q=8+1=9$.

Then the maximum minus the minimum of $q+r$ is $9-5=4$.

My argument is essentially based upon the fact that $2^x$ grows slower than $3^x$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.