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!

### Like this:

Like Loading...

*Related*

Got it!

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

Does negative 100 count? lol..

Just invert all the signs.

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

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.

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

Took about 10 minutes. 4 signs

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

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

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.

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

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.

Found one with only 3 signs in about two minutes

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.

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.

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

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.

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

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

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

Some three minutes four signs

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)

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.

3 signs, about 3 minutes.

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

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

Related

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

Dear friend,

I think you should only use + or – sign only.

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.

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

This is cool. I got 3 sign only. Solved around 5 minutes.

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

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.

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.

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.

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!

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!

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.

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

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

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.

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.

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)

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

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

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 😀

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?

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

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

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

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!

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

I wrote a program too. You can even vary the inputs to test for other values and numbers of digits. Enjoy!

I used python. It makes things a bit cleaner. http://pastebin.com/VmS4mYx5

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

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.

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

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

I’ve charted the number of solutions by goal value between 1 and 100. Not much of a pattern.

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

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

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

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

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.

Are brackets allowed?

Not needed.

Three symbols in just over 2 minutes

Hold on… Let me ask Emma… 🙂

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

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

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

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

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.

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

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

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

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

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.

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

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

~20m, 3 signs.

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

I’d love to see that 1 line program…

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

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

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

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.

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?

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.

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…

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.

about 8 mins, 4 signs

Yes!!

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

I think it was a great article

this is going to take way too much time

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

3 signs and 1 min !

3 minutes 10 seconds. Is that a record ?

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;

}