Some surprising sums—and a challenge

December 9, 2015 • 2:45 pm

by Matthew Cobb

This was tw**ted earlier today:

There are five other sums (equations?) that give the same answer. Can you find them? Post your answers below.

 

32 thoughts on “Some surprising sums—and a challenge

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

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

    2. cheating for the nerdy inclined:
      perl -E “say for grep{eval==100} glob join ‘{+,-,}’, 1..9”

      I’ll suppress the output to avoid spoilers.

      1. 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’)

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

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

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

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

    1. Hope I don’t insult your intelligence by asking if you noted that each sum uses the numbers 1-9 in order.

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

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

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

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

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

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

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

Comments are closed.