Minimum Digit Sum Fraction

Algebra Level 3

Let S ( N ) S(N) denote the digit sum of the integer N N . As N N ranges over all 3-digit positive numbers, what value of N N would give the minimum of M = N S ( N ) M = \frac{N}{S(N)} ?

Details and assumptions

The number 12 = 012 12=012 is a 2-digit number, not a 3-digit number.

The digit sum of a number is the sum of all its digits. For example the digit sum of 1123 is 1 + 1 + 2 + 3 = 7 1 + 1 + 2 + 3 = 7 .


The answer is 199.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

16 solutions

Ahaan Rungta
May 20, 2014

This is a 3-digit number, so we can call the digits A B C, where A 0 A \ne 0 . This means: N = 100 A + 10 B + C N = 100A + 10B + C and S = A + B + C S = A + B + C . So, by the definition of M M , we have: M = 100 A + 10 B + C A + B + C M = \frac {100A + 10B + C}{A + B + C}

Remark that this can be re-written as M = 99 A + 9 B A + B + C + 1 M = \frac {99A + 9B}{A + B + C} + 1 . Consider this as a function of C and notice that C only appears in the denominator. We want to minimize this, so we want to maximize C; i.e. C = 9 C = 9 . [Note: It doesn't matter what positive values A and B are. - Calvin]

Substituting this into the equation above, we obtain: M = 99 A + 9 B A + B + 9 + 1 = ( 90 A 81 ) ( 9 A + 9 B + 81 ) A + B + 9 + 1 M = \frac {99A + 9B}{A+B+9} + 1 = \frac {(90A-81)(9A+9B+81)}{A+B+9} + 1 . Now, M M can be rewritten as M = 90 A 81 A + B + 9 + 9 + 1 = 90 A 81 A + B + 9 + 10. M = \frac {90A-81}{A+B+9} + 9 + 1 = \frac {90A-81}{A+B+9} + 10. Again, we wish to minimize this so, in the same manner, we note that B only appears in the denominator in this function of B. Clearly, we want to maximize B to minimize this fraction. So, B = 9 B = 9 .

Substituting B = 9 B = 9 into this, we get: M = 90 A 81 A + 18 + 10. M = \frac {90A-81}{A+18} + 10. Now, haste makes waste! We cannot just conclude that A = 9 A = 9 as well. In fact, it's quite clear that 999 isn't the best we can do. Note that M = 90 A 81 A + 18 + 10 = 90 A + 90 × 18 90 × 18 81 A + 18 + 10 = 90 90 × 18 + 81 A + 18 + 10. M = \frac {90A-81}{A + 18} + 10 = \frac {90A + 90 \times 18 - 90 \times 18 - 81} { A + 18} + 10 = 90 - \frac {90 \times 18 + 81} { A + 18} + 10 . Aha! We want to minimize this expression, so we want to maximize 1 A + 18 \frac {1}{A+18} . And, to do this, we need to minimize A, since A is in the denominator. This is reverse logic from what we did with B and C. Since A can't be 0 (if it was, we wouldn't have a 3-digit number), A must be 1.

So, we got: A = 1, B = 9, C = 9, so the answer is 199 \fbox{199} .

I think you made a small mistake... when you write (99A+9B)/(A+B+9) +1 = (90A-81)(9A+9B+81)/(A+B+9), I think you mean that it equals [(90A-81)+(9A+9B+81)]/(A+B+9)

João Morais - 5 years, 4 months ago

Nice solution bro! I forgot that the numbers could repeat and i answered 189 in my third attempt. :-(

José Bezerra Carvalho Júnior - 5 years, 8 months ago

A 3 digit number where the digits are a,b & c has a value N=100a+10b+c and a digit sum a+b+c. The problem is to minimise M ( N ) = 100 a + 10 b + c a + b + c M(N)= \frac{100a+10b+c}{a+b+c} . We are also told it must be a three digit number so 1 a 9 1\leq a\leq9 and 0 b 9 , 0 c 9 0\leq b\leq 9, 0\leq c\leq 9 . It is reasonably intuitive to see at this point that a should be as small as possible and c as large as possible. More rigorously one can look at the partial derivatives to see the slope of the function M(N) for the digits a,b & c.

a M ( N ) = 100 a + b + c 100 a + 10 b + c ( a + b + c ) 2 \frac{\partial}{\partial a}M(N)=\frac{100}{a+b+c}-\frac{100a+10b+c}{(a+b+c)^2} b M ( N ) = 10 a + b + c 100 a + 10 b + c ( a + b + c ) 2 \frac{\partial}{\partial b}M(N)=\frac{10}{a+b+c}-\frac{100a+10b+c}{(a+b+c)^2} c M ( N ) = 1 a + b + c 100 a + 10 b + c ( a + b + c ) 2 \frac{\partial}{\partial c}M(N)=\frac{1}{a+b+c}-\frac{100a+10b+c}{(a+b+c)^2}

This confirms the intuition as a M ( N ) > 0 \frac{\partial}{\partial a}M(N)>0 and b M ( N ) < 0 \frac{\partial}{\partial b}M(N)<0 and c M ( N ) < 0 \frac{\partial}{\partial c}M(N)<0 for all allowed values.

Hence a=1, b=9, c=9 and N=199 is the solution.

Eric Nie
May 20, 2014

Let N = 100 x + 10 y + z N = 100x+10y+z , and hence S ( N ) = x + y + z S(N) = x+y+z .

Thus M = 100 x + 10 y + z x + y + z = 99 x + 9 y x + y + z + 1 M = \frac{100x+10y+z}{x+y+z} = \frac{99x+9y}{x+y+z} + 1

Since 1 is a constant, M is minimized when 99 x + 9 y x + y + z \frac{99x+9y}{x+y+z} is minimal.

Since z only appears in the denominator, 99 x + 9 y x + y + z \frac{99x+9y}{x+y+z} is minimized when z is maximized which in this case is 9.

Substituting 9 for z obtains 99 x + 9 y x + y + 9 = 9 ( 11 x + y x + y + 9 ) \frac{99x+9y}{x+y+9} = 9(\frac{11x+y}{x+y+9}) .

Once again since the 9 is a constant, we can not worry about it.

11 x + y x + y + 9 \frac{11x+y}{x+y+9}

Testing values of x, we clearly see that the fraction above is minimized when x = 1 x=1 .

x = 1 , 11 + y 10 + y ; x = 2 , 22 + y 11 + y ; x = 3 , 33 + y 12 + y x = 1, \frac{11+y}{10+y}; x = 2, \frac{22+y}{11+y}; x = 3, \frac{33+y}{12+y}

Substituting in x=1, 11 + y 10 + y = 1 + 1 10 + y \frac{11+y}{10+y} = 1 + \frac{1}{10+y} .

Clearly, 1 10 + y \frac{1}{10+y} is minimized when y is maximized, hence y = 9.

Therefore M is minimal when N = 199 \boxed{N = 199} .

good solutions

Rosadi Zuko - 5 years, 7 months ago

Nice solution

Hamit Hood - 5 years, 4 months ago
Erick Wong
May 20, 2014

We are minimizing (100a + 10b + c) / (a + b + c). Think of this as computing the average of a copies of 100, b copies of 10, and c copies of 1. Clearly such an average will be between 1 and 100, so every time we increase c by 1, or decrease a by 1 the average goes down. Consequently for the optimal solution, c must be as large as possible and a must be as small as possible: c = 9 and a = 1. This gives an average (not counting b yet) of 109/10 = 10.9. Since this quantity is greater than 10, every increase in b will lower the average further, so the optimal solution must have b = 9.

Aakash Kansal
May 20, 2014

Let number be 100a+10b+c Then N1 N/s(n)= (100a+10b+c)/a+b+c Now taking the number N2 as 100+10b+(c+1) where And evaluating n/s(n) for this number and comparing this fraction with previous one we get (100a+10b+c)/(a+b+c) , (100a+10b+c+1)/(a+b+c+1) As here numerator and denominator both are +ve so we can cross multiply without changing the inequality So we get (100a+10b+c)>(a+b+c) So this ratio is greater for the fraction with unit digit greatest hence c=9 Solving for b simillarly we have to compare (100a+10b+c)/(a+b+c) and (100a+10(b+1)+c)/(a+(b+1)+c) Again cross multiplying we get (100a+10b+c)and 10 (a+b+c) 90a-9c>0 so So to make this fraction minimum we should maximize b also Hence b=9 Now for a We have to compare fractions as (100a+10b+c)/(a+b+c) and (100(a+1)+10b+c)/((a+1)+b+c) Again cross multiplying we get 100a+10b+c<100 (a+b+c) 0<90b+99c
So by increasing the hundred place digit by one we get the ratio to be greater than the previous one So we should make a minimum thus a=1 And ans is 199

Calvin Lin Staff
May 13, 2014

Let N = a b c = 100 a + 10 b + c N = \overline{abc} = 100a + 10b + c where 1 a 9 1 \leq a \leq 9 , 0 b 9 0 \leq b \leq 9 and 0 c 9 0 \leq c \leq 9 .

We have a b c a + b + c = 100 a + 10 b + c a + b + c = 99 a + 9 b a + b + c + 1 \frac {\overline{abc}} {a+b+c} = \frac{100a + 10b + c}{a+b+c} = \frac {99a + 9b}{a+b+c} + 1 . Thus, the minimal occurs when c = 9 c=9 .

Substituting c = 9 c=9 , we have 99 a + 9 b a + b + 9 + 1 = 90 a 81 a + b + 9 + 9 + 1 \frac {99a + 9b} { a+ b + 9} + 1 = \frac {90 a - 81}{a+b + 9} + 9 + 1 . Thus, the minimal occurs when b = 9 b = 9 .

By considering the graph of the rational function 90 a 81 a + 18 \frac {90a - 81}{a+18} , it is increasing on [ 1 , ) [1, \infty) , thus the minimal occurs when a = 1 a=1 .

Therefore N = a b c = 199 N= \overline{abc} = 199 gives the minimal value of M M which is 199 99 \frac{199}{99} .

Good solution! I think you made a typo at the last line, shouldn't it be 199 19 \frac{199}{19} .

Mohammad Al Ali - 5 years, 11 months ago
Tahmid Hasan
May 20, 2014

Notice that from a 00 \overline {a00} to a 99 \overline {a99} , a 99 \overline {a99} gives the minimum value of M M . So checking 199 199 to 999 999 yields 199 199 gives the minimum value.

Michael Martin
May 20, 2014

199. First select lowest 3 digit number 100. Divide it by its S(n) which will give a 100(Which is certainly not a minimum). Then select largest 3 digit number 999. Divide it by its S(n) which will give a 37 approx. then check for 899. you'll see that it becomes even lesser then it is clear that lowest will be that for 199(M about 10!). Answer is 199.

Gabriel Ravel
May 20, 2014

Letting our three digit number d e f def be such that d e f = 100 a + 10 b + c def = 100a +10b +c , we see that M = 100 a + 10 b + c a + b + c M=\frac{100a+10b+c}{a+b+c} .

The batting average lemma states that if a b c d \frac{a}{b} \le \frac{c}{d} then a + b c + d c d \frac{a+b}{c+d} \le \frac{c}{d} .

So now we start with n = 100 n=100 and consider what happens if we add, batting average style, to each digits place: we add a fraction of value corresponding to the value of the place.

So, and this is not fully rigorous but it does suffice after a little numerical testing at the extreme ranges to see if the pattern holds, we see that increasing b b and c c decreases the value of M M but that increasing a a does not. So we let b b and c c be 9 9 and a a be 1 1 and our answer is that the minimum value of M M occurs at n = 199 n=\boxed{199}

if we want M to be minimum the we should consider N as minimum and S(N) as maximum if we want N to be minimum we should consider it as little more than a hundred but less than 200 but we should also keep in mind that S(N) should be maximum so in the integer N we should have 9 and 1 and the most reasonable answer for this is 199.

John Norman Beren
May 20, 2014

To get the minimum value of M which is equal to N/S(N), you should minimize the numerator N and maximize the denominator S(N).

Since we are dealing with 3-digit number, the minimum value of denominator is 100 and maximum value of denominator is 27 (from 3-digit no., 999 or 9+9+9=27).

Trying to get M for the max numerator, 100/1 = 100 trying to get M for the min denominator, 999/27 = 37

We can analyze from above, to get min M, we have to get a smaller value of N but with high sum of its digits. So we can say, that in the number we are looking for, it has atleast one digit 9 in it. But to make it smaller, we should put the 9 on the ones digit.

So we have, 109. Trying to get M, 109/10 = 10.9 so less than 37 Considering 2 9's but making it relatively small, we will have 199. Trying to get M, 199/19 = 10.47 < 10.9

So how we will be able to know if it is the minimum?

Let N = 100a + 10b + c S(N) = a + b + c

Considering a smaller M as equal to 10.

so 10 = (100a + 10b + c)/(a + b + c)

Simplifying, we will have 10a = c, where b is cancelled.

so it means, to have M equal to 10, the ones digit should be 10 times the hundredths digit, which is impossible. So, we consider 9 instead as the highest unit digit number. Thus, a should be 1 and c should be 9. So, we could have M as 1b9. Since b was cancelled from the equation, any value of b will still produce 10.something of M. Thus, to get the smallest value of M, we have to maximize b which is 9.

Thus the minimum value of M is 199

Maedeliene Uy
May 20, 2014

Let's start with the least 3-digit number. N=100, S(N)=1, N/S(N)= 100

Next, with the largest 3-digit number. N=999, S(N)=27, N/S(N)= 37

By doing these, you can deduce that the biggest denominator you can have is 27 only. Since you want to minimize N/S(N), you want the denominator to be largest and numerator to be the least.

As much as possible, you want to use the digit 9 in your N to get a high denominator. We can put the digits 9 in the ones and tens place. We want the least number in the hundreds place to have least N/S(N). Therefore N=199.

Eu Jing Chua
May 20, 2014

package brilliant;

public class Brilliant {

public static void main (String[] args) {
    double min = 999;
    double M = 0;
    int N = 0;

    for (int i = 100; i <= 999; i++) {
        M = (double) i / sumDigits (i);
        if (M < min) {
            min = M;
            N = i;
        }
    }

    System.out.println ("N = " + N);
}

public static int sumDigits (int n) {
    if (n >= 10) {
        return n % 10 + sumDigits (n / 10);
    }
    else {
        return n;
    }
}

}

Abhishek Anand
May 20, 2014

Here, the numerator (N) of the fraction should be minimum and denominator (S(N)) should be maximum. Hence, the numerator must be in 100's and denominator should be an addition of the digits of max. magnitude (i.e, 9).

Summing up, we get, Numerator can be 109, 119,... and Denominator can be (1+0+9), (1+1+9),... respectively. By trial and error, 109/(1+0+9)= 10.9; 119/(1+1+9)= 10.81 ; and so on....

Hence, observing the pattern we see that as we increase the numerator by 10, the fraction keeps decreasing. Hence at 199/(1+9+9)= 10.47 , the fraction should be minimum.

For further verifying it, we take 299/(2+9+9)= 14.95 ; 399/(3+9+9)= 19 ; and so the value of the fraction keeps increasing as we increase the numerator. Hence, we conclude that the fraction "M" has minimum value when N=199.

Anqi Li
May 20, 2014

Firstly, to simplify matters, let us assume that N/S(N)=z. Let us also express N as 100a+10b+c. We are able to write 100a+10b+c=(a+b+c)*z -----(1)

Here we need a key observation, that z >10. We will prove this by contradiction. Let us assume z=10. Then we can write 100a+10b+c=10a+10b+10c <=> 90a=9c <=> 10a=c. Since 10 is a two digit number and c is a single digit number, for a>0, no solution for c is possible.

Therefore we can write z as (z-10)+10 since the 10 cancels out. we substitute it back into (1), we get 100a+10b+c=(a+b+c)((z-10)+10) Expanding and rearranging, we get 9(10a-c)/(a+b+c)=z-10 ----------(2)

If we can minimise z-10, then 10+(z-10) will also be minimised since 10 is a constant. In order to minimise z-10, we want to maximise the denominator and minimise the numerator of the fraction in the left hand side of equation (2).

First, we look at the denominator and see how we can maximise it.We observe that b is present only in the denominator which makes it a constant so we can maximise it. Therefore, we see that b=9.

Next, we want to minimise the denominator, in other words, we want to maximise c but minimise a. However, note that the a is a positive integer, i.e. a>0.Therefore, we let c=9 and a=1.

Summarising the above steps, we first wrote a fraction concerning 10-z and we would want to minimise it. Then we used analysis and showed that a=1,b=9 and c=9. Therefore, the answer to the above question is 199.

As per question, we require to maximize S(N) & minimize N. Also note with decrease in numerator the N S ( N ) \frac {N}{S(N)} decreases abruptly while with decrease in denominator, it increases (keeping other constant)... A large S(N) is obtained when N has large digits,while we need N to be small as well,so we include 9 s one by one, to maximize digit sum,but with 9 s the N increases as well, so for hundred's digit,we take 1. We get the fraction to 10.47. Let's now test against this value.

Clearly, if we increase hundred's digit...the number increases many fold,& fraction for 299 is 14.95. So we need not test further values.

All remains is to test if ten's digit is decreased, then fraction increases slightly as denominator decreases by 1,but numerator by 10. We have for 189 the fraction is 10.5. Hence,we need not test further values & we are done...

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...