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!

1. Kitty says:

Got it!

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

1. Joao Pedro Afonso says:

Just invert all the signs.

2. tried didnt work.. got too 123 when I inverted.. I always get things backward. 😛

3. Joao Pedro Afonso says:

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.

4. David Wiley says:

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

2. Luis says:

Took about 10 minutes. 4 signs

3. linzi catt says:

about 5 mins 6 signs though 😦 be interesting to see others solutions!!!

4. Thomas says:

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

5. Thomas Widmer says:

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.

6. James says:

Took a couple of minutes using a calculator, 4 signs. 😀

7. elsiem says:

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.

8. Found one with only 3 signs in about two minutes

9. 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. Joao Pedro Afonso says:

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.

2. Joao: Will try to explain it Monday provided I can still remember it by then.

10. stu says:

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.

11. Steve Ulven says:

Trial and error here as well. Took about five minutes.

12. CaptSasquatch says:

Got it! 3 signs, roughly 3-4 minutes. Used a calculator and trial and error.

13. Cosmo Steve says:

I started to write some code to figure this out then I stopped.

14. Mchl says:

Some three minutes four signs

15. Rob says:

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)

16. Rob says:

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.

17. Stephen Barnes says:

18. Marta says:

Got it! First I got an answer with 6 sings and a couple of minutes later, 3 sings!

19. Got the + and – answer in about 10 minutes, 4 signs.

Related

1+2+3+4+5+6+7+(8*9) = 100

20. Marcus E says:

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.

21. 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”……

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

23. Local Government Officer says:

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.

24. Derek says:

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.

25. Tim B says:

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.

26. Joao Pedro Afonso says:

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. Joao Pedro Afonso says:

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!

27. Kris says:

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. Local Government Officer says:

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

2. Joao Pedro Afonso says:

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. Joao Pedro Afonso says:

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. Derek says:

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. Local Government Officer says:

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)

28. nebalia says:

3 signs, between 5&10 minutes (distracted by an enthralling Antiques Roadshow)

29. slightly_skeptical says:

10 seconds, must have got lucky. 3 signs, 4 numbers.

30. Lumpy Jay says:

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 😀

31. Lumpy Jay says:

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. Local Government Officer says:

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

2. Lumpy Jay says:

As soon as I clicked submit I realised that’s what was meant oops :s

3. Not really nine numbers. You should combine the digits. Please see example.

32. Derek says:

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!

33. Wolf Martinus says:

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

1. Very interesting recursive way to build up the operator lists. I like it.

2. Michel says:

Fascinating how people think and solve this problem. I immediately went to recursion (http://pastebin.com/uvrkp3it), but I’m fascinated some people did not.

34. Mark O says:

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

35. Manuel says:

3 signs about one minute… it was luck I guess.

1. DeepField says:

Who would have guessed that 88 was the least common target?

36. Arnab Bose says:

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. Arnab Bose says:

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

2. Arnab Bose says:

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

37. Stuart says:

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.

38. John says:

Three symbols in just over 2 minutes

39. Hold on… Let me ask Emma… 🙂

40. Simon says:

Yep, 11 solutions, 12 if it can start with -1. A one-line Mathematica program!

1. Joao Pedro Afonso says:

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

2. Kris says:

I’d like to see it too. If I were going to be a one-liner, it’d be something like http://pastebin.com/17JYq0u2 (although I wouldn’t put it on one line).

3. Simon says:

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]}]

4. Simon says:

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.

41. Savio says:

10 minutes. One solution with 6 signs and one with 3 signs.

42. DeepField says:

Ten minutes. Trial and error. 6 answers so far. The one with three signs was the first one.

43. 10 minutes of trial and error. Got it to total 98. Rounded up. Called it a day.

44. Got one using 4 symbols. I’m proud of myself, don’t play with my illusions of intelligence.

45. norbert says:

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.

46. Sofie says:

Got it! Took about two minutes with a calculator :).

47. hala says:

I’ve managed it with four symbols! Feels like Countdown! 🙂

48. Miguel says:

~20m, 3 signs.

49. Gib says:

A “C” program got the same results as others for me.

I’d love to see that 1 line program…

1. Kris says:

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

50. Garrett says:

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

51. Got it with three symbols in about one minute, with the help of my trusty calculator.

52. Jerry says:

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. Jerry says:

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. Anonymous says:

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. Local Government Officer says:

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…

53. Ian says:

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.

54. FormerComposer says:

55. Fraser says:

Yes!!

A solution using three signs, and about… half a day!

56. I think it was a great article

57. Zach says:

this is going to take way too much time

58. ZZCK says:

Got it in about 3 minutes. 4 numbers, 3 signs. Had no particular technique though.

59. Shyam says:

3 signs and 1 min !

60. Smylers says:

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

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