# 1 2 3 4 5 6 7 8 9 = 100

The sequence of numbers $1\ 2\ 3\ 4\ 5\ 6\ 7\ 8\ 9$ has the property that you can insert mathematical operators in between the numbers from $1$ to $9$ and make the expression evaluate to 100. For example:

$$1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 \times 9 = 100$$

There are possibly hundreds of solutions to this problem, involving different varieties of operators. What is the expression with the fewest number of operators inserted (out of the set $+, -, \times, \div$ and maybe $\sqrt{}$ and $!$) that evaluates to 100?

• Can I insert a symbol between = and 100? Apr 13 '15 at 19:45
• @JoeZ. You should define the question such that you don't need to make ex post facto judgements on what is or isn't allowed. You failed to specify specifically which "mathematical symbols" are allowed and their meaning. Numbers are symbols, and they are used in mathematics. Taking it a step farther, I could invent a new operator with its own symbol (as is often done in mathematics) and define it to always evaluate to 100. Stick it anywhere on the left and voila: 100 = 100, one added symbol. Apr 14 '15 at 1:10
• @JoeZ. I wasn't complaining or implying that my hypothetical solution should be considered a valid solution to the puzzle, but trying to point out that if you explicitly listed the specific operators and their acceptable meanings (some operators have different or multiple meanings in different areas of mathematics) you would not need to contend with a plethora of "clever" solutions utilizing lateral thinking. Apr 14 '15 at 1:47
• @JoeZ. I believe my first comment was and still is quite constructive: it gives specific advice for how to describe the puzzle less ambiguously. Namely, by listing each symbol/operator which is acceptable and what meaning it has. What irritates me is when people misinterpret constructive criticism and cry foul instead. Apr 14 '15 at 2:07
• @bcrist I apologize. I got antsy about this because I've been accused of moving the goalposts in much the same way at PCG.SE (the code golf site) more than once, and it pattern-matches to people complaining about "chameleon questions" where people do indeed believe their loophole-abusing solutions should be considered valid even if they ruin the challenge, almost as a penalty to the question-asker for not making the question clear enough in the first place. Looking back at my first reply to you, some of my negativity was pretty uncalled for, so I've just deleted my comments.
– anon
Apr 14 '15 at 5:50

I believe that this is the smallest:

$$123 - 45 - 67 + 89 = 100$$

• This is the smallest one I know of too, but let's see if someone can beat it.
– anon
Apr 13 '15 at 19:37
• This is the best, according to worldofnumbers.com/ninedig1.htm
– JLee
Apr 13 '15 at 20:13
• Unless something like 123456789>=100 counts, I couldn't find a better one either Apr 13 '15 at 20:14
• Verified shortest possible solution. Dec 18 '16 at 18:20

Note: This answer only applies prior to the edit that clarifies that the expression on the left must evaluate to 100, rather than simply the equation being true.

If you allow exponents, you can get away with just two:

$1^{ 23456789 } = 10^0$

• Well, you're not supposed to be able to insert anything between the digits of 100, but +1 for creativity.
– anon
Apr 14 '15 at 3:17
• @EngineerToast 00 is not nonsense, though. Surely you understand it (and therefore it makes sense). Apr 14 '15 at 12:17
• @EngineerToast It would be 2 operations since you could write 1^23456789=10^0 Apr 14 '15 at 16:01
• Also, $0^0$ is undefined.
– anon
Apr 14 '15 at 16:28
• @pacoverflow +1 Good optimization. Apr 14 '15 at 22:06

Best I can do so far is tie the smallest (3 operators):

1234%567%8^9 = 100
which Wolfram Alpha interprets as:
$(1234\bmod567)\bmod8^9 = 100$
$(100)\bmod8^9 = 100$

For those who are unfamiliar, % is the modulo operator. Throw the equation in wolfram alpha.

EDIT: Started on finding this solution before the operator limit was imposed. Not valid under the rules of the current question.

• How exactly does that work? I can't figure out which % applies first.
– anon
Apr 14 '15 at 18:22
• Modulus works at the same level as multiplication/division in the order of operations. As such, no parenthesis are needed. The exponent is resolved first, then we work left to right with the modulus signs. Apr 14 '15 at 18:27
• @Mwr247: I know what you mean. My answer was posted before the edit, too. People still keep upvoting it, though. -_- Apr 14 '15 at 18:36
• @IanMacDonald To be fair, yours was particularly clever hehe... Anyways, unless the rules change to allow modulo (which it totally should, given how ubiquitous it is), I've added a note to my answer indicating that it's not technically valid. Thanks again everyone =) Apr 14 '15 at 18:40
• @jjdb Parentheses are used to override the normal order of operations, and themselves have a place in that order (albeit at the top). When not specified, the implicit order is to solve from left to right. Parentheses are therefore not required, but rather, recommended for clarity. The case you gave as an example, without parenthesis, would evaluate as: 78 / 10 / 7 = 1.1143... approx. Apr 16 '15 at 13:37

## Addendum too long for a comment

I can confirm there is no better solution than Andrew Smith's if we use the operators +-*/.^ There is only one solution using 3 operators. There are two using 4:

123 +45 - 67 + 8 - 9
123 + 4- 5 + 67 - 89


There are 215 possibilities total and the number of solutions for the number of operators breaks down as follows:

Operators   Solutions
0           0
1           0
2           0
3           1
4           2
5           9
6           57
7           104
8           42


We could throw in some more operators though I doubt they would help. I didn't try parentheses, floors, mod, sqrt, etc. If anyone wants a go, though, here's some (unoptimized) VBA that will brute force the basic operators in Excel:

Sub doTheMath()

Const op As String = " +-*/.^"
Dim s As String
Dim a, b, c, d, e, f, g, h
Dim i, j
Dim v

'Loop all possibilities
i = 2
j = 1
For a = 1 To Len(op):    For b = 1 To Len(op):    For c = 1 To Len(op):    For d = 1 To Len(op)
For e = 1 To Len(op):    For f = 1 To Len(op):    For g = 1 To Len(op):    For h = 1 To Len(op)
s = 1 & Mid(op, a, 1) & 2 & Mid(op, b, 1) & 3 & Mid(op, c, 1) & 4 & Mid(op, d, 1) & 5 & _
Mid(op, e, 1) & 6 & Mid(op, f, 1) & 7 & Mid(op, g, 1) & 8 & Mid(op, h, 1) & 9
v = Application.Evaluate(Replace(s, " ", ""))
If CStr(v) = CStr(100) Then
Cells(i, 1).Value = s
Cells(i, 2).Value = v
i = i + 1
End If
j = j + 1
If j > 1000000 Then
ThisWorkbook.Save
j = 1
End If
Next:    Next:    Next:    Next:    Next:    Next:    Next:    Next

End Sub

• @stuartstevenson I can confirm there is no better solution than Andrew Smith's if we use the operators +-*/.^ There is only one solution using 3 operators. The solution you posted is the one solution using 3 operators that was posted by Andrew Smith. Jan 8 '20 at 13:16

Disclaimer: I do not own any of the answers. This is only an arrangement of all the answers. Credits to Andrew Smith, Ismael Miguel, Mwr247, Ian MacDonald and Engineer Toast.

2 operators:

$$1^{23456789}= 10^0$$ (by Ian Macdonald)

3 operators:

$$123−45−67+89=100$$ (by Andrew Smith)

$$1234\%\,567\%\,8^9 = 100$$ (by Mwr247)

4 operators:

$$123 +45 - 67 + 8 - 9$$ (by Engineer Toast)

$$123 + 4- 5 + 67 - 89$$ (by Engineer Toast)

7 operators:

$$-(12+34-56)\times (-7+8+9)=100$$ (by Ismael Miguel)

So far, answerers need to figure out a solution with 2 operators only to update the record.

• Hope you like the edit! If not, let me know as soon as you can, or just implement a rollback. Apr 12 '19 at 0:21
• Consider editing this to make it a community wiki. I do not own any of the answers. This is only an arrangement of all the answers. Jul 16 at 14:14

I'm adding this because I like it and I remember figuring it out as a child.

$$((1+2) \times 3 + 4 + 5) \times 6 - 7 + 8 - 9 = 100.$$

It's nice because the order of operations work left to right and I guess is technically the shortest without the concatenation or modulo functions.

This is my 2nd attempt.

This time I'm using 7 operations.

I couldn't find any shorter than this, for now.

-(12+34-56)*(-7+8+9)


I've tried and tried and tried.

This simply multiplies 10 by 10.

Nothing fancy, sadly too long, nothing that can't be done easily...

But well, it solves the case!

I know that technically I do not have a shorter solution, but I applied the modulo operator and found an answer!

123456789 % 123456689 = 100

and so on. The program I used:

#include <iostream>

int
main()
{
for (int i = 100; i < 999999999; i++)
{
if (123456789 % i == 100)
{
std::cout << i << std::endl;
}
}
}

• Welcome to Puzzling SE! Your answer seems to be a bit off-topic, you aren't supposed to use additional numbers than those given by the author! Apr 14 '15 at 11:38
• @leoll2 oops, I did read "what is the fewest number or operators" Apr 14 '15 at 14:06
• of, not or. Don't worry, it happens :)
– anon
Apr 14 '15 at 16:11
• 123456789 % 169 = 92, not 100. Apr 18 '18 at 13:48

Here are some answers I found.

\begin{align}100 &= 1 \times (- 2) + 3 \times 4 + 5 + 6 +7 + 8 \times 9 \\ &= 12 - 3 + 4 \times 5 + 6 + 7 \times 8 + 9 \\ &= 1 + 2 + 3 - 4 + 5 + 6 + 78 + 9 \\ &= 12 + 34 - 5 + 6 \times 7 + 8 + 9 \\ &= 1 \times 2 + 3 \times 4 + 5 - 6 + 78 + 9 \\ &= 1 \times 2 \times 3\times 4 + 5 + 6 -7 + 8 \times 9 \\ &= 1 \times 2 + 34 + 56 + 7 - 8 + 9.\end{align}

The trick is

including negatives from $$-2$$ to $$-8$$. There appears to be a solution when each of these terms are included in each sum to equal $$100$$. Strange, ain't it?

Just wanted to point out that trick.

I'm not sure this is what you're looking for, but 123456789=/=100

• You can't do that, though. The symbol =/= doesn't mean anything, and even if you were trying to change it to $\neq$, that's specifically disallowed.