# Using the digits $1-9$ each only once find the closest sum to $1000$.

Using the digits $1-9$ each only once find the closest sum to $1000$ by filling in the following spaces.

$$_ _ _+_ _ _+_ _ _$$

I tried to get $1000$ but couldn't (not even sure if you can). So then I tried $999$. I was able to get $152+378+469=999$ by guess and check but am not able to even to check if that is the correct answer. I believe there are $9!$ possible choices. I was wondering if there is some logical mathematical reasoning to get to the correct answer and prove it correct.

By the divisibility by 9 rule (and these numbers add up to 45, i.e. divisible by 9), whatever sum you produce, the digits of the sum will always be divisible by 9, and hence 999 is the best you can do.

• Such an elegant solution!
– John
Jan 11, 2017 at 21:18
• @John mine was so similar :'( *sniff* *sniff* haha
– RGS
Jan 11, 2017 at 21:23
• Question, though isn't this not exactly the by divisible 9 rule. You got to factor in carrying over. Isn't the divisibility rule a number is divisible by $9$ if the sum of its digits are? @Bram28 Jan 11, 2017 at 22:16
• @AhmedS.Attaalla The beautiful thing of the divisibility by 9 rule is that it does factor in carrying over. E.g if I add 24 (where 24 mod 9 = 6 = (2+4) mod 9) and 37 (where 37 mod 9 = 1 = (3+ 7) mod 9) then I get 61 (where 61 mod 9 = 7 = (6+1) mod 9 = (2+4+3+7) mod 9). Jan 11, 2017 at 23:00

One can prove that there is no way to sum up to $1000$:

Using all digits only once to write three $3$-digit numbers will yield a sum that is congruent with $0$ modulus $3$; $1000$ is congruent with $1$ and $1001$ with $2$, so $999$ is the closest you can get. Guessing the final answer is just fine.

• @Faibbus Sum of digits is the way to show divisibility by $3$... Jan 11, 2017 at 21:32
• @Faibbus Proof or not, if it is widely known, a full proof is probably not necessary. To me, this was obvious. Jan 11, 2017 at 21:43
• Such an elegant solution! ;)
– John
Jan 12, 2017 at 18:21

There's a strategy you can use to find a solution that adds to 999, convert one solution into others, and once you understand how it works it's easy to see that 1000 is impossible. Using this method I found $128+375+496$ in a couple of minutes, and I can easily turn that into $176+395+428=999$ or $478+326+195=999$.

First just write down any three numbers, even if they don't work, say

    147
258
369


This adds to 774, which is too small. But what happens if we switch two digits in the same row? Say we switch the 4 and the 7. This adds 30 to the total (because the 4 in the tens' column becomes a 7) and takes away 3 (because the 7 in the units' column becomes a 4) for a net gain of 27. So the total now must be $774+27=801$:

    174
258
369


The total is 801, so we want to increase it by around 200. So we should look for a digit in the hundreds' place that is 2 less than the digit in the units' place. When we switch these the total will increase by 200 and decrease by 2. None of the three rows does this. For example, if we were to switch the 2 and the 8 in the second row the total would increase by around 600 which is too much.

But if 258 were 254 instead, then switching it to 452 would increase the total by about 200. And we can turn 258 into 254 by switching the 4 and the 8. This doesn't change the total at all, because 174 increases by 4 and 258 decreases by 4:

    178
254
369


The total is still 801.

Switching the 2 and the 4 works:

    178
452
369


Now the total is exactly 999 and we win.

If we want another solution, just switch any two digits in the same column, say the 3 and the 1:

    378
452
169


And it's still 999.

If you think a little more about what is happening here you will see why it's not possible to make 1000 exactly.