Determine the smallest integer that is divisible by 24 and has digit sum equal to 24.
Details and assumptions
The digit sum of an integer is the sum of all its digits. For example the digit sum of 1123 is 1 + 1 + 2 + 3 = 7 .
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.
This problem has numerous wrong solutions. You should read the other solutions to understand what is wrong with the logic presented, and learn from their mistakes.
Often, you have to be extremely careful with the arguments that you use to justify that your answer is indeed the minimum (or the maximum). For questions that ask for the minimum of the maximum of some expression, it can get even trickier.
Wouldn't this be an easier way:
The smallest number will obvious be 3 digits (since 2 doesn't work). The only digit combinations are:
996 987 888
With respective permutations. We easily see that 8 8 8 works with divisibility rules.
Log in to reply
That's not completely true, although it's the way I've used. There are other possible combinations: 699, 789, 798, 879, 888, 897... and many others.
Log in to reply
But we can straight away skip the odd ones.
the no. should be even, so we are left with 996 and 888!
why ans. is not numbers like 168,240......as they are divisble by 24 too??
Log in to reply
Well, only numbers 0-999 are accepted. And, we want to find the LEAST, the SMALLEST number. 1 6 8 , 2 4 0 is divisible by 24, but is not the least.
Log in to reply
This answer is not correct. The reason why answers like 168, 240, etc, are not valid is that the digit sum must be equal to 24. This means that each digit of the number is added to get 24. For example:
168: 1+6+8=15 240: 2+4+0=6 888: 8+8+8=24
All of them can be divided by 24, but only 888 has digit sum equal to 24.
since the no. is divisible by 24,it may have any of 4,8,2,6,0 as unit digit.we want the smallest no. with multiple 24 and digit sum 24 as well.so the gretest no. 8 should be at unit place (least significant) causing the sum of other 2 digits to be 16. now there are 2 possibilities: 16=9+7 or 7+9 or 8+8 we put the digits and find that 798 is not divisible by 24 888 is divisible by 24. we dont require to check the other no. so the required no. is 888.
PS: if we assume unit digit to be 6 then the two other digits have to be 9 and 9. there is no other possible unit digit
I would disagree with the justification "we want the smallest number, so the greatest number (8) should be at the unit place".
If you want to minimize a number, you should start with the most significant digit, and not the least significant.
How can we directly show that the units digit must be 8?
Given that the digit sum equal to 24,integers with only 1 or 2 digits are impossible.So,we look for an integer with 3 digits, a b c .
We know that a + b + c = 2 4 and 1 0 0 a + 1 0 b + c ≡ 0 ( m o d 2 4 ) ⇒ 4 a + 1 0 b + c ≡ 0 ( m o d 2 4 ) Now,we have two equations: 4 a + 1 0 b + c = 2 4 k and a + b + c = 2 4 . By subtracting the second equation from the first one,we get 3 a + 9 b = 2 4 k − 2 4 ⇒ a + 3 b = 8 k − 8 ⇒ a + 3 b ≡ 0 ( m o d 8 ) ⇒ a + 3 b = 8 m
From a + b + c = 2 4 ,we know that 6 ≤ a , b , c ≤ 9 . With the condition given, we first try with a + 3 b = 2 4 ⇒ a = 6 , b = 6 , c = 1 2 which is impossible.
We proceed with a + 3 b = 3 2 ⇒ a = 8 , b = 8 , c = 8
We conclude that the smallest integer which is divisible by 24 and its digit sum is 24 is 8 8 8
I have a solution which doesn't involve breaking up the number into separate digits and using modular arithmetic: Let x be the number we desire to find. Since it is divisible by 24:
x = 0 ( m o d 2 4 )
Since its digits add up to 24, we use the fact that a number modulo 9 will equal its digit sum since 1 0 0 a + 1 0 b + c = a + b + c ( m o d 9 ) , however, 2 4 = 6 ( m o d 9 ) so instead we use 2 7 since it is a multiple of 9 and 2 4 = 2 4 ( m o d 2 7 ) .
x = 2 4 ( m o d 2 7 )
Least common multiple of 2 4 and 2 7 is 2 1 6 , manipulating our two equations we get:
9 x = 0 ( m o d 2 1 6 )
8 x − 1 9 2 = 0 ( m o d 2 1 6 )
They are both multiples of 216, thus:
9 x + 2 1 6 k = 8 x − 1 9 2 for any integer k
x = − 1 9 2 − 2 1 6 k
Since the smallest number with digits that can add up to 2 4 is 6 9 9 (by inspection), x ≥ 6 9 9
Which implies:
− 1 9 2 − 2 1 6 k ≥ 6 9 9
Smallest solution for 1 9 2 − 2 1 6 k is in fact at k = − 5 , therefore: x = − 1 9 2 − 2 1 6 × − 5
x = 8 8 8
Log in to reply
Nice approach trying to use the Chinese Remainder Theorem.
However, can you justify why x ≡ 2 4 ( m o d 2 7 ) ?
Note that 4 4 8 8 satisfies the conditions above, but 4 4 8 8 ≡ 2 4 ( m o d 2 7 ) .
If possible, the optimum solution would have to be a three-digit integer, because two-digit integers can only have a maximum digit sum of 9+9=18, whereas three-digit integers can have up to 9+9+9=27.
To find a small three-digit number with digit sum 24, we want to minimize the hundreds digit by maximizing the tens and ones. However, to be divisible by 24, the number has to be divisible by 2, and 4 (the 6 is guaranteed if the integer is divisible by 2 and has a digit sum of 24, which is divisible by 3). Therefore, we know that the maximum value of the ones digit is 8, and the maximum value of the tens digit is 8, because 88 is the largest multiple of 4 with the highest digit sum. Then, the obvious first digit is 24-8-8=8, so the answer is 888.
The justification provided in this solution is wrong.
Consider the question: Find the smallest integer that is a multiple of 8 and has a digit sum of 23.
Let's use his argument:
First, it is clear that the solution must have at least three digits.
To find a small three-digit number with digit sum 23, we want to minimize the hundreds digit by maximizing the tens and ones. However, to be divisible by 8, the number has to be divisible by 2, and 4. Therefore, we know that the maximum value of the ones digit is 8, and the maximum value of the tens digit is 8, because 88 is the largest multiple of 4 with the highest digit sum. Then, the obvious first digit is 23-8-8=7, so the answer is 788.
However, 788 is not a multiple of 8. Hence the answer must be 1688. s q u a r e
Why is this wrong? You can check that 968 is a smaller number which satisfies the conditions.
Where did he go wrong?
I took a similar approach but mostly used the sum restriction to narrow the choices.
After determining that an optimal number had to be three digits in length, I determined the hundreds digit could not be any smaller than 6. If it were, the sum could never add up to 24 (take 599 as an example).
Moving to the 6's, the only candidate is 699, which is odd (and therefore not divisible by 24).
Moving to the 7's, the only two possibilities are 789 (odd, no good) and 798 (I used 720 as a known multiple of 24 and excluded 798 as a result.)
Moving to the 8's, the only possibilities are 879 (odd), 897 (odd), and 888.
888 is certainly divisible by 8, and is also divisible by 3 (using the standard sum of digits method). Therefore, 888 is the minimum.
Log in to reply
Of course, any number that has a digit sum of 24 must be a multiple of 3.
So this question is essentially looking for a multiple of 8.
you can be positive that the solution cannot be a >4-digit integer by noting the fact that the number has to be in the range 0-999.
step 1: Download Python 2.7
step 2: Install python
step 3: Run this code
for i in range(1,10000):
S=sum(int(x) for x in str(i))
>if (S is 24) and (i % 24) is 0:
>>print i
>>break
Output: 888
Gotcha!!:)
kuya try lng :)
if the digit is a 2 digit number a b then the maximum digit sum is 9 + 9 = 1 8 but if it is a three digit number a b c the maximum digit sum is 9 + 9 + 9 = 2 7 so there is a chance that the number is a three digit number
if 6 ≤ a , b , c ≤ 9 and a b c is divisible by 24 meaning c can only be 6 or 8 and if a is even then b c is divisible by 8 but if a is odd then b c is divisible by 4 only
if c = 6 then a = 9 and b = 9 only having a b c = 9 9 6 a is odd and b c = 9 6 is divisible by 8 so 9 9 6 cannot be the number
if c = 8 then 7 ≤ a ≤ 9 and 7 ≤ b ≤ 9 only
if a is odd {7,9} and b c = 9 8 or b c = 7 8 are both not divisible by 4 so a is not an odd number
if a is even {8} and b c = 8 8 is divisible by 8 so a is 8 and b c = 8 8
we will have a b c = 8 8 8
Log in to reply
marami talaga magagaling na Pilipino..:) puro na lang kac mathematical approach mga solution dito.. kaya ngdecide aqu bakit hindi programming..:)
u can run this code in java: int s=0,n,i; for(i=1;s!=24;i++){ n=24 i;s=0; while(n>0) { s+=n%10; n/=10;}} System.out.println(24 --i);
I guess that can work, too...
When searching for the smallest integer that has a digit sum of 24, you want to first start with as few digits as possible. The fewest digits you can start with is 3; a 6 and two 9's. You make the smallest integer you can with these digits (699) and then see if it is divisible by 24. You continue by adding 1 to the 6 and subtracting 1 from the first 9. Following this method, you will get the numbers 789, 798, 879, and finally 888, the correct answer.
for a number to be divisible by 24 it should at least be even and a multiple of 3.
the answer is obviously 3 digit so let 9 be at the hundred's place the only even number with digit sum 24 is 978 but it is not divisible by 24
now let 8 be at the hundred's place the only even number with digit sum 24 is 888 and it is divisible by 24
now let 7 be at the hundred's place the only even number with digit sum 24 is 798 but it is not divisible by 24
similarly 699 is also not divisible by 24. 5,4,3,2 or 1 cannot be at the hundred's place because the digit sum must be 24
so the answer is 888
888 is the first integer which digit sum is 24 and luckily it is divisible by all the factors of 24.....so this is the correct answer...
The first statement is not true. 699 has a digit sum of 24.
8+8+8=24 & 888 is divisible by 24 which is least integer
This merely shows that 888 satisfies the conditions. It doesn't show that it is the smallest integer which satisfies the conditions.
Problem Loading...
Note Loading...
Set Loading...
Let the integers 0 ≤ a , b , c ≤ 9 be the digits of the desired integer in base 10 (where c is least significant)
Then a + b + c = 2 4
So c = 2 4 − ( a + b ) , implying a + b ≥ 1 5 , hence a ≥ 6 .
Also, 2 4 ∣ 1 0 0 a + 1 0 b + c Substituting c gives 2 4 ⟹ 8 ∣ 9 9 a + 9 b + 2 4 ∣ 1 1 a + b
Enumerating solutions, a = 6 , b = 6 is invalid, a = 7 , b = 3 is invalid, a = 8 , b = 0 is invalid, a = 8 , b = 8 is valid, which gives 8 8 8 the smallest solution.