How can you place the arithmetical signs ‘+’ and ‘-‘ between the consecutive numbers 123456789 so that the end result is 100?  So, for example, you could go…..

12+34+56-7-89 , but that would make 6, so that doesn’t work.

Try to come up with the method that uses the least number of symbols.

As ever, please do NOT post your answers, but do feel free to say if you have a solution and how long it took.  See you Monday.

Update: @spacemagick has written to program to generate solutions and claims there are 11 solutions, of which one uses only 3 symbols!

98 comments

  1. Got it!

    Maybe 5 minutes of playing around with the numbers, but I wonder if there’s a more systematic way.

    1. When I first told you that, I was under the impression that you could have a solution starting with a minus sign. Since then, I know we can not.

    2. Curiously there is only one solution for -100 once you preclude a leading minus sign.

  2. Cool… first number puzzle I solved on first attempt: 4 signs (or is that a spoiler? if so, please edit post)

  3. I found one with 3 signs, three with 4 signs, 6 with 6 signs and 1 with 7 signs.
    I admit that I used excel.

  4. I came up with an answer that uses four signs in about a minute and was very pleased with myself, but having seen that Thomas Widner can do it in three I’m going to keep trying.

  5. Using a systematic method, I got a solution with three signs.

    As for time taken, I can only be approximate, but perhaps three or four songs have played in the background while I was working on it.

    My approach was to draw a sort of crude tree diagram implemented as lines of indented text in Notepad. For example, one line in the diagram lists the four numbers that “1,2,3,4,5,6” might sum to if the solution continues “±78±9”. The tree is actually quite small if you omit obvious dead ends.

    1. I think your solution method is the one I’m most curious to know Monday. Can you explain it better that day? Or posting a drawing in your blog? I resort in my paper and pen approach to nines out, tables of partial sums with nines out, module operations (basically odd and even pairings) but in the end, I used trial and error as likely the same everyone. Wasted time. But your method appears promising.

  6. No systematic methond for me!! Just trial and error.

    I got a solution with 4 signs in about five minutes. Managed to get a solution using three signs about 15 minutes later.

  7. I am feeling so good right now.
    Yeah baby.
    Oh yeah.
    Uh huh.
    Okay.

    1 answer, less than 2 minutes, 3 symbols.

    So elegant. Thank you Richard.
    (Sorry for bragging, but last week I had a complete block and failed all weekend to understand the puzzle, let alone answer it. It still confuses me…bloody probability. Give me arithmetic any time)

  8. BTW, I used a version of trial and error, but like a previous contributor, I worked on the assumption that a lot of combos were no use and started with numbers that hovered around the target mark.

  9. It took me about 10 minutes for three symbols. I tried some obscure numbers, got close but no cigar. I may try for 4 or more symbols next and see if there is a pattern.

  10. ugh……aaahhh…..errrr….#$%$^#$@%$%^{just think Mel Gibson should get ya there}….don’t know why I’m getting total failure…..should be easy…..wwwhhhhhhyyyy can’t I think???? OK I got the weekend…..all I can see is a gorilla playing basket ball in a room with girls and the curtains keep changing color while a monkey in a box in the corner whispering “someone is gonna die”……

  11. Neverrrr mind…..I got it one so far used 4 signs……phewwww….was starting to really worry. OK took me awhile…lost count of how long….but I got at least one! Now I can tell that monkey to take a flying leap….hehehe

  12. 2 signs. A few minutes proving that further a one sign solution is not possible; rather longer proving that most of the possible digit lengths corresponding to a putative two sign solution cannot lead to success; and, for the sole remaining configuration, 5 minutes to determine a solution (which I doubt is unique) by systematic trial and error.

  13. Trial and error here. Actually just trial, first attempt got me a four-sign solution.
    After reading that there was a three-sign solution it took me another couple of minutes to get. There was only one possible set of numbers that would give a three-sign solution so it was just a matter of changing the signs.

  14. Took about 10 mins for a 3 sign solution, 5 mins reading the comments on this page looking for hints and 5 minutes trial and error in Excel.

    Slightly too hungover this morning to think of a systematic approach to this, might have a bash later at finding the other solutions.

  15. Okay, I got it. The hard way, it took me ten minutes to reach a solution I believe is the best, plus more ten devising strategies in the end I didn’t use. Then I did the easy way to see how many different solutions… after half an hour, there is so many?, Wow!

    1. hmm… saying the number of signs spoils a lot, since it reduces a lot the number of trials. But every one is saying them, so, here’s my number: 3 signs between 4 terms, using paper and pen. And the number of total solutions (for the benefice of @Thomas Widmer), is 12, if my processes after that are right. I hate this idea of giving too much, but then, the smart solvers doesn’t read the comments before think on the problem, and might use them to achieve more. My admiration for the ones who got more than 4 terms using trial and error!

  16. 3 signs and a few thousand clock cycles.

    To the above poster, a 2 sign solution is not possible. There are 11 solutions and the shortest uses three signs.

    1. You are mistaken, Kris, unless we are defining our terms differently. Two signs, three numbers.

    2. 12 solutions, @Kris. And I’m eager that Monday comes so I can see @Local Government Officer solution, since I think I proved that impossible in my calculations (you are not using implicit multiplications aren’t you?)

    3. Oops, I’m seeing now where I’m wrong. There is a solution starting with a -1, but the puzzle asks for signs between the numbers, so it should not be counted. My apologies for correcting you.

    4. I’m pretty confident now that a two-sign solution is impossible. The only remotely plausible candidates begin with 1234 or 123, and it doesn’t take long to discover that they’re both dead ends.

    5. Derek, Kris, my apologies, I had misread (or rather not read) the question. Truly a schoolboy error!. You are indeed quite correct that there is no two sign solution; these can be immediately eliminated by inspection. Therefore 3 is best one can do. More generally, however, it is the case that by removing the restriction for the numbers to be in consecutive order, the lowest number of operations to achieve 100 is 2 and this can only be achieved with a 3.3.3 configuration (not, e.g. 4.4.1)

  17. I’ve got two answers with four and five signs in about 5 minutes … albeit using a calculator (my mental arithmetic is not what it once was!). I’m going to have another play later to see if I can get more solutions 😀

  18. I got the impression that you have to use the consecutive numbers 1 – 9 so everyone should be using 9 numbers – or am I wrong?

    1. Nine digits, so between nine and two numbers (assuming at least one aritmetical operation!)

  19. Kris: I was just coming to the same conclusion. I thought I was going to have to use a systematic approach to confirm it but I’ll take your word for it instead!

  20. Took me 10 minutes to write my own program. can confirm the solution of the update, 11 solutions, using from 3 to 7 symbols.

  21. First try. 3 signs in about 10 seconds. Think I must have seen it somewhere else since I don’t feel like a mathwiz.

  22. I confirm there are eleven solns one wtih 3 symbols. Took me about 15 minutes to write the C# code – too long I guess.

    1. Also if you allow a ‘-‘ sign in the beginning (which you can’t according to the rules) there is only one more.

    2. If you allow the ‘*’ and ‘/’ operations, then there are 97 ways to get 100.

  23. I used a program also, but a much less elegant brute force approach using random numbers to determine whether to put a ‘+’, ‘-‘ or nothing between each digit.

    1. I want to see that, Monday too. So far, we have here Excel, Python, JavaScript, and my one was VB Script.

    2. Sorry it took me so long to reply: Here’s my one-line (in the front-end) solution:

      Select[Tuples[{“+”, “-“, “”}, 8], ToExpression[str = StringJoin[Riffle[Characters[“123456789”], #]]] == 100 &]

      or one that prints out the solutions in a nicer form:

      Do[If[ToExpression[str = StringJoin[Riffle[Characters[“123456789”], i]]] == 100, Print[“100=”,str]], {i, Tuples[{“+”, “-“, “”}, 8]}]

    3. I should not that this takes about 1/5th of a second to run.
      Also, the solution is very similar to the Pythonic one of Kris.

  24. And the smallest positive integer that cannot be the sum of such a sequence is 160… the next one is 178.

    there are 26 solutions for a sum of 1 or 45. There is only one solution for a sum of 176.

    1. You really went with C? My C version took about 5 times as long to write as my Python version (although it runs about 40 times as fast).

  25. lots of formulas in MS Excel. Got the same 11 solutions as the other programmers.

    1 using 7 symbols
    7 using 6
    2 using 4
    1 using 3

  26. Got an answer in about a minute or so, but it has four plus and minus signs in the answer. I will see if it is possible with fewer.

    1. Later in the day, I found one with three signs. Skimming the other answers, I have not seen any fewer. Did someone find an answer with two signs that I missed?

    2. It looks like Local Government Officer found an answer with two signs. As I understand this problem, you must keep the digits in consecutive order. For example, a solution could contain the number 123 but not the number 321 or 132.

    3. I’m afraid I didn’t Anonymous – I hadn’t read the problem properly and neglected the constraint to keep the numbers consecutive. See earlier post…

  27. 3 signs in a few seconds plus the time to get a calculator to check I wasn’t mad. There was some logic in the way I did it, thinking about large numbers first and working from right to left.

  28. I’ll avoid posting the answer, but I came up with a very short Perl program for finding it:

    foreach (glob join q[{,-,+}], 1 .. 9)
    {
    say if eval == 100;
    }

Leave a reply to Ian Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.