# Number theory question

$K$ is a three digit number such that the ratio of the number to the sum of its digits is least. What is the difference between the hundreds and the tens digits of $K$
a) 9
b) 8
c) 7
d) None of these

I was able to solve this question by using hit and trial but could not think of a proper way to solve it.

-
what was the hit and trial solution for this... – Praphulla Koushik Oct 7 '13 at 9:29
as stated below, it was 199 which gives answer as 8 – Suy Oct 7 '13 at 9:52

We want to minimise $\cfrac {100a+10b+c}{a+b+c}$

This is equal to $$1+\frac{99a+9b}{a+b+c}$$ and this is clearly least when c is greatest. So we have $c=9$.

We then rewrite the fraction as $$100-\frac{90b+99c}{a+b+c}$$ which is least when $a$ is least. So we have $a=1$.

Isolating $b$ as above gives $$10+\frac {90a-9c}{a+b+c}$$ Since $a$ is non-zero the numerator is positive and the minimum is obtained when $b=9$.

-

Convince yourself that the higher the units digit and tens digit, the smaller the ratio will be. Then convince yourself that a higher hundreds digit will make the ratio bigger. From here, it is clear that the number must be $199$, and the solution is $|1-9| = 8$ hence (b).

Why you want the units digit to be higher:

Let the number be $x$ and the digital sum be $d$.

Increase the units digit by $1$ (without changing the hundreds digit).

Then $x/d > (x+10)/(d+1)$ iff $xd + x > xd + 10d$ iff $x > 10d$.

If $x = 100a + 10b + c$ is a three digit number, then:

$x > 10d$ iff $100a + 10b + c > 10a + 10b + 10c$ iff $90a - 9c > 0$ iff $9(10a - c) > 0$.

Since $a\neq0$ and $c$ are digits, we know that $10a > c$; hence the last inequality holds, so that the new ratio is, indeed, smaller. A similar analysis can be carried out for the other digit places in the event that "convince yourself" is not convincing enough.

-
Yes the answer is 199 as per the book but how will it generalize say for a four or five digit number. You took the hundreds digit as the smallest and maximized both the tens and units digits. I did the same thing by placing different digits and finding the ratio. However, I couldn't understand why its becoming the least on taking both the units and hundreds digit as the largest possible and how will it generalize to bigger numbers? – Suy Oct 7 '13 at 9:52
@Suy I added in some extra comments for this problem since "convince yourself" is not always so clear. (The intended meaning of this phrase, by the way, is: Try to work out the details to demonstrate why this is true!) – Benjamin Dickman Oct 7 '13 at 10:01