by Matthew Cobb
This was tw**ted earlier today:
1+2+34–5+67–8+9 =100
12+3–4+5+67+8+9 =100
123–4–5–6–7+8–9 =100
123+4–5+67–89 =100
123+45–67+8–9 =100
123 –45 –67+89 =100— Simon Pampena (@mathemaniac) December 9, 2015
There are five other sums (equations?) that give the same answer. Can you find them? Post your answers below.
Here’s a couple:
12-3-4+5-6+7+89 = 100
-1+2-3+4+5+6+78+9 = 100
must get back to work now 🙂
Your first can be modified to produce another one, by noting that 3+4=7 so if you reverse the sign on those three digits it will work the same way. As in:
12+3+4+5-6-7+89 = 100
-1 doesnt count (well it does, but that’s not one of the five).
cheating for the nerdy inclined:
perl -E “say for grep{eval==100} glob join ‘{+,-,}’, 1..9”
I’ll suppress the output to avoid spoilers.
But is there a simple proof of the number of solutions, without brute force?
I don’t know if there is a Python one-liner. The best I can do:
import itertools
seen = set()
for sign_array in itertools.product([”, ‘+’, ‘-‘], repeat=9):
st = ‘{}1{}2{}3{}4{}5{}6{}7{}8{}9’.format(*sign_array).lstrip(‘+’)
if st not in seen and eval(st) == 100:
seen.add(st)
print(st, ‘= 100’)
Thanks for this. I’m just learning Python, and working through your solution was very educational…especially after having gone down a completely wrong road of my own first 🙂
WordPress ate your quotes. But otherwise, it works.
1+2+3+4×5+67-8-9
oh yeah, = 100. Don’t know if multiplication counts.
1+23-4+56-7-8-9=100
typo, should read
1+23-4+56+7+8+9=100
also
1+23-4+5+6+78-9=100
Here’s one:
1+2+3-4+5+6+78+9 = 100
If you are allowed to put a – sign in front of the 1, you can also create a variant:
-1+2-3+4+5+6+78+9 = 100
I’d like to offer the following conjecture:
“All solutions will contain exactly four odd integers.”
The rules, as I see them, are that minus and plus signs are the only allowed operators, and it’s okay for the expression to begin with a minus sign (such as -1 or -12).
Anyone care to find either an exception or a proof?
Here’s a half proof…
There must be an even number of odd addends to sum to an even number (like 100). There are 5 odd digits from 1..9 so the number of odd addends must be 0, 2 or 4. There is always at least one odd addend, i.e., one that ends with the digit 9, so there are either 2 or 4 odd addends. Haven’t thought of a way to eliminate 2 other than brute force.
Are there only five other sums (equations?) that give the same answer?
Hope I don’t insult your intelligence by asking if you noted that each sum uses the numbers 1-9 in order.
It’s interesting to see how the number of solutions varies, depending on the number you’re summing to. I ran gillsj’s code on the numbers from 0 to 100, and the number with the greatest number of solutions (using just + and -, and allowing initial negative numbers) is 9, with 46 solutions.
And the smallest number with only one solution is 176: 1-2+34+56+78+9
And now I am really going to quit, watch an episode of “Broadchurch”, and go to bed…
Do you have a sibling named Sinister Edge? 😉
We don’t talk about that side of the family 🙂
x : y – z + x + y – z + x – y + x – y + z + x X y = 100
100 = 100 : 1 – 2 + 3 + 5 – 60 + 70 – 80 + 9 + 5 X 2.
No 4?
A variant on the problem
Using no combined digits, just the numbers 1 to 9, followed by 10 and with multiplication.
(1+2+3) x (4×5) – (6+7+8+9) + 10 = 100
Here’s a summary of ‘legal’ contributions so far (notably, -1 at the beginning is evidently not allowed):
12-3-4+5-6+7+89 = 100 (Mark)
12+3+4+5-6-7+89 = 100 (Eric riffing on Mark’s)
1+23-4+56+7+8+9 = 100 (Ralph)
1+2+3-4+5+6+78+9 = 100 (Eric)
At this point we are missing one.
I’m still sad about the -1 (non-)rule. I was proud of myself for that one. I know what the remaining one is but I obtained it illegally – I’m not proud of myself for that.
I’m still fiddling with it in spare moments, but I doubt I’ll get enough of those to figure it out in the next 10-12 hours, so post away if you feel the desire.
okay, I guess enough time has passed…so, here you go:
1+23-4+5+6+78-9 = 100
In fact we had all 5 soon after the post went up yesterday. Look above, I put this one up too, just before eric put up the last missing one.
Indeed you did!
Congrats to us.
I missed it in my list! Sorry Ralph.
eric