Playing the game of 24

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 1 + 1 + 2 + 3 = 7 .


The answer is 888.

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.

9 solutions

Cheng Sun
Aug 19, 2013

Let the integers 0 a , b , c 9 0 \le a,b,c \le 9 be the digits of the desired integer in base 10 (where c c is least significant)

Then a + b + c = 24 a+b+c=24

So c = 24 ( a + b ) c=24-(a+b) , implying a + b 15 a+b \ge 15 , hence a 6 a \ge 6 .

Also, 24 100 a + 10 b + c 24 \mid 100a+10b+c Substituting c c gives 24 99 a + 9 b + 24 8 11 a + b \begin{aligned} 24 &\mid 99a+9b+24 \\ \implies 8 &\mid 11a+b \end{aligned}

Enumerating solutions, a = 6 , b = 6 a=6, b=6 is invalid, a = 7 , b = 3 a=7, b=3 is invalid, a = 8 , b = 0 a=8, b=0 is invalid, a = 8 , b = 8 a=8, b=8 is valid, which gives 888 888 the smallest solution.

Moderator note:

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 888 \boxed{888} works with divisibility rules.

Sameer L. - 7 years, 9 months ago

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.

Miguel Gallego Munuera - 7 years, 9 months ago

Log in to reply

But we can straight away skip the odd ones.

A Former Brilliant Member - 7 years, 9 months ago

the no. should be even, so we are left with 996 and 888!

Rishabh Raj - 7 years, 3 months ago

why ans. is not numbers like 168,240......as they are divisble by 24 too??

Ayush Goyal - 7 years, 9 months ago

Log in to reply

Well, only numbers 0-999 are accepted. And, we want to find the LEAST, the SMALLEST number. 168 , 240 168,240 is divisible by 24, but is not the least.

Akira Sonoda - 7 years, 9 months ago

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.

Miguel Gallego Munuera - 7 years, 9 months ago
Mukul Suryawanshi
Aug 19, 2013

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

Moderator note:

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?

Jia Zheng Chai
Aug 19, 2013

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 \overline{abc} .

We know that a + b + c = 24 a+b+c=24 and 100 a + 10 b + c 0 ( m o d 24 ) 4 a + 10 b + c 0 ( m o d 24 ) 100a+10b+c \equiv 0 \pmod{24} \Rightarrow 4a+10b+c \equiv 0 \pmod{24} Now,we have two equations: 4 a + 10 b + c = 24 k 4a+10b+c=24k and a + b + c = 24 a+b+c=24 . By subtracting the second equation from the first one,we get 3 a + 9 b = 24 k 24 a + 3 b = 8 k 8 a + 3 b 0 ( m o d 8 ) a + 3 b = 8 m 3a+9b=24k-24 \Rightarrow a+3b=8k-8 \Rightarrow a+3b\equiv 0 \pmod{8} \Rightarrow a+3b=8m

From a + b + c = 24 a+b+c=24 ,we know that 6 a , b , c 9 6\leq a,b,c \leq 9 . With the condition given, we first try with a + 3 b = 24 a = 6 , b = 6 , c = 12 a+3b=24 \Rightarrow a=6, b=6 , c=12 which is impossible.

We proceed with a + 3 b = 32 a = 8 , b = 8 , c = 8 a+3b=32 \Rightarrow a=8,b=8,c=8

We conclude that the smallest integer which is divisible by 24 and its digit sum is 24 is 888 888

I have a solution which doesn't involve breaking up the number into separate digits and using modular arithmetic: Let x x be the number we desire to find. Since it is divisible by 24:

x = 0 ( m o d 24 ) x=0\pmod{24}

Since its digits add up to 24, we use the fact that a number modulo 9 will equal its digit sum since 100 a + 10 b + c = a + b + c ( m o d 9 ) 100a+10b+c=a+b+c\pmod{9} , however, 24 = 6 ( m o d 9 ) 24=6\pmod{9} so instead we use 27 27 since it is a multiple of 9 9 and 24 = 24 ( m o d 27 ) 24=24\pmod{27} .

x = 24 ( m o d 27 ) x=24\pmod{27}

Least common multiple of 24 24 and 27 27 is 216 216 , manipulating our two equations we get:

9 x = 0 ( m o d 216 ) 9x=0\pmod{216}

8 x 192 = 0 ( m o d 216 ) 8x-192=0\pmod{216}

They are both multiples of 216, thus:

9 x + 216 k = 8 x 192 9x+216k=8x-192 for any integer k k

x = 192 216 k x=-192-216k

Since the smallest number with digits that can add up to 24 24 is 699 699 (by inspection), x 699 x \geq 699

Which implies:

192 216 k 699 -192-216k \geq 699

Smallest solution for 192 216 k 192 - 216 k is in fact at k = 5 k=-5 , therefore: x = 192 216 × 5 x=-192-216 \times -5

x = 888 x=888

Victor Phan - 7 years, 9 months ago

Log in to reply

Nice approach trying to use the Chinese Remainder Theorem.

However, can you justify why x 24 ( m o d 27 ) x \equiv 24 \pmod{27} ?

Note that 4488 4488 satisfies the conditions above, but 4488 ≢ 24 ( m o d 27 ) 4488 \not \equiv 24 \pmod{27} .

Calvin Lin Staff - 7 years, 9 months ago
Matt Wang
Aug 18, 2013

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.

Moderator note:

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 _square

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.

Daniel Cohen - 7 years, 9 months ago

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.

Calvin Lin Staff - 7 years, 9 months ago

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.

Daniel Wang - 7 years, 9 months ago

Log in to reply

Haha, touche!

Matt Wang - 7 years, 9 months ago
Mharfe Micaroz
Aug 19, 2013

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 \overline{ab} then the maximum digit sum is 9 + 9 = 18 9+9=18 but if it is a three digit number a b c \overline{abc} the maximum digit sum is 9 + 9 + 9 = 27 9+9+9=27 so there is a chance that the number is a three digit number

if 6 a , b , c 9 6 \leq a,b,c \leq 9 and a b c \overline{abc} is divisible by 24 meaning c c can only be 6 6 or 8 8 and if a a is even then b c \overline{bc} is divisible by 8 but if a a is odd then b c \overline{bc} is divisible by 4 only

if c = 6 c=6 then a = 9 a=9 and b = 9 b=9 only having a b c = 996 \overline{abc} = 996 a a is odd and b c = 96 \overline{bc} = 96 is divisible by 8 so 996 996 cannot be the number

if c = 8 c=8 then 7 a 9 7 \leq a \leq 9 and 7 b 9 7 \leq b \leq 9 only

if a a is odd {7,9} and b c = 98 \overline{bc} = 98 or b c = 78 \overline{bc} = 78 are both not divisible by 4 so a a is not an odd number

if a a is even {8} and b c = 88 \overline{bc} = 88 is divisible by 8 so a a is 8 8 and b c = 88 \overline{bc} = 88

we will have a b c = 888 \overline{abc} = 888

Ian Mana - 7 years, 9 months ago

Log in to reply

marami talaga magagaling na Pilipino..:) puro na lang kac mathematical approach mga solution dito.. kaya ngdecide aqu bakit hindi programming..:)

Mharfe Micaroz - 7 years, 9 months ago

Log in to reply

pwede rin po syang gawin sa microsoft excel. :)

Ian Mana - 7 years, 9 months ago

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);

Ayush Alankar - 7 years, 9 months ago

I guess that can work, too...

Jeremy Shuler - 7 years, 4 months ago
Brian Traub
Aug 22, 2013

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.

Snehdeep Arora
Aug 22, 2013

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

Chiku Kumar
Aug 20, 2013

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

Moderator note:

The first statement is not true. 699 has a digit sum of 24.

Majid Lone
Aug 19, 2013

8+8+8=24 & 888 is divisible by 24 which is least integer

Moderator note:

This merely shows that 888 satisfies the conditions. It doesn't show that it is the smallest integer which satisfies the conditions.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...