47
$\begingroup$

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?

$\endgroup$
19
  • 5
    $\begingroup$ Can I insert a symbol between = and 100? $\endgroup$ Apr 13, 2015 at 19:45
  • 11
    $\begingroup$ @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. $\endgroup$
    – bcrist
    Apr 14, 2015 at 1:10
  • 4
    $\begingroup$ @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. $\endgroup$
    – bcrist
    Apr 14, 2015 at 1:47
  • 4
    $\begingroup$ @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. $\endgroup$
    – bcrist
    Apr 14, 2015 at 2:07
  • 3
    $\begingroup$ @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. $\endgroup$
    – anon
    Apr 14, 2015 at 5:50

10 Answers 10

67
$\begingroup$

I believe that this is the smallest:

$123 - 45 - 67 + 89 = 100$

$\endgroup$
4
  • 1
    $\begingroup$ This is the smallest one I know of too, but let's see if someone can beat it. $\endgroup$
    – anon
    Apr 13, 2015 at 19:37
  • 2
    $\begingroup$ This is the best, according to worldofnumbers.com/ninedig1.htm $\endgroup$
    – JLee
    Apr 13, 2015 at 20:13
  • 31
    $\begingroup$ Unless something like 123456789>=100 counts, I couldn't find a better one either $\endgroup$ Apr 13, 2015 at 20:14
  • 2
    $\begingroup$ Verified shortest possible solution. $\endgroup$
    – Oliver Ni
    Dec 18, 2016 at 18:20
93
+50
$\begingroup$

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 $

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

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.

$\endgroup$
11
  • $\begingroup$ How exactly does that work? I can't figure out which % applies first. $\endgroup$
    – anon
    Apr 14, 2015 at 18:22
  • 4
    $\begingroup$ 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. $\endgroup$
    – Mwr247
    Apr 14, 2015 at 18:27
  • 1
    $\begingroup$ @Mwr247: I know what you mean. My answer was posted before the edit, too. People still keep upvoting it, though. -_- $\endgroup$ Apr 14, 2015 at 18:36
  • 1
    $\begingroup$ @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 =) $\endgroup$
    – Mwr247
    Apr 14, 2015 at 18:40
  • 1
    $\begingroup$ @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. $\endgroup$
    – Mwr247
    Apr 16, 2015 at 13:37
17
$\begingroup$

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
$\endgroup$
1
  • $\begingroup$ @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. $\endgroup$ Jan 8, 2020 at 13:16
3
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ Hope you like the edit! If not, let me know as soon as you can, or just implement a rollback. $\endgroup$
    – Mr Pie
    Apr 12, 2019 at 0:21
  • $\begingroup$ 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. $\endgroup$ Jul 16, 2021 at 14:14
2
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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!

$\endgroup$
0
$\begingroup$

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;
        }
    }
}
$\endgroup$
4
  • 6
    $\begingroup$ 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! $\endgroup$
    – leoll2
    Apr 14, 2015 at 11:38
  • $\begingroup$ @leoll2 oops, I did read "what is the fewest number or operators" $\endgroup$
    – Theolodis
    Apr 14, 2015 at 14:06
  • $\begingroup$ of, not or. Don't worry, it happens :) $\endgroup$
    – anon
    Apr 14, 2015 at 16:11
  • $\begingroup$ 123456789 % 169 = 92, not 100. $\endgroup$ Apr 18, 2018 at 13:48
0
$\begingroup$

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.

$\endgroup$
-5
$\begingroup$

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

This answer adds two symbols, "=" and "/".

$\endgroup$
5
  • 2
    $\begingroup$ 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. $\endgroup$
    – anon
    Apr 14, 2015 at 0:20
  • $\begingroup$ Would you be happier with "123456789 != 100"? ! meaning "not" is listed in wikipedia's big list of math symbols en.wikipedia.org/wiki/List_of_mathematical_symbols $\endgroup$
    – DiscOH
    Apr 14, 2015 at 1:03
  • 10
    $\begingroup$ Well, the problem is with the word "equation". Sure you've made the statement true, but it's no longer an equation. $\endgroup$
    – anon
    Apr 14, 2015 at 1:37
  • $\begingroup$ @JoeZ. An equation is an equality with at least one variable. What you mean is an equality. $\endgroup$
    – user26486
    Apr 14, 2015 at 23:23
  • $\begingroup$ Well, in any case I've edited the question statement again and that removes any ambiguity with regards to my choice of word when it comes to "equation". $\endgroup$
    – anon
    Apr 15, 2015 at 0:04