Creating arithmetic expression equal to 1000 using exactly eight 8's and parentheses

1.7k Views Asked by At

I would like to find all the expressions that can be created using nothing but arithmetic operators, exactly eight $8$'s, and parentheses.

Here are the seven solutions I've found (on the Internet) so far:

\begin{align} 1000 &= (8888 - 888) / 8\\ 1000 &= 888 + 88 + 8 + 8 + 8\\ 1000 &= 888 + 8 \cdot (8 + 8) - 8 - 8\\ 1000 &= 8 \cdot (8 \cdot 8 + 8 \cdot 8) - 8 - 8 - 8\\ 1000 &= 8 \cdot (8 \cdot (8 + 8) - (8 + 8) / 8) - 8\\ 1000 &= (8 \cdot (8 + 8) - (8 + 8 + 8) / 8) \cdot 8\\ 1000 &= (8 \cdot (8 + 8) - 88 / 8 + 8) \cdot 8 \end{align}

Are there others, and if there are, what are they?

Update

After sifting through achille hui's answer and adding one of mathlove's solutions, I get the following $16$ possibilities:

\begin{align} 1000 &= (8888 - 888)/8\\ 1000 &= 888 + (888 + 8)/8\\ 1000 &= 888 + 88 + 8 + 8 + 8\\ 1000 &= 888 + (8 + 8) \cdot (8 - 8/8)\\ 1000 &= 888 - (8 + 8) \cdot (8/8 - 8)\\ 1000 &= 888 + 8 \cdot (8 + 8) - 8 - 8\\ 1000 &= (888 \cdot (8/8 + 8) + 8)/8\\ 1000 &= 8 \cdot (8 - 88/8 + 8 \cdot (8 + 8))\\ 1000 &= 8 \cdot 8 - 88 + 8 \cdot 8 \cdot (8 + 8)\\ 1000 &= 8 \cdot 8 \cdot (8 + 8 - 8/(8 + 8)) + 8\\ 1000 &= 8 \cdot (8 \cdot 8 + 8 \cdot 8) - 8 - 8 - 8\\ 1000 &= 8 \cdot (8 \cdot (8 + 8) - 8/8) - 8 - 8\\ 1000 &= 8 - 8 \cdot (8 \cdot (8/(8 + 8) - 8 - 8))\\ 1000 &= (8 - 8/(8 \cdot 8)) \cdot (8 + 8) \cdot 8 - 8\\ 1000 &= (8\cdot 8\cdot 8-8)\cdot (8+8)/8-8\\ 1000 &= (8 + 8) \cdot (8 \cdot 8 - (8 + 8)/8) + 8 \end{align}

If any of these are equivalent, please let me know.

2

There are 2 best solutions below

3
On BEST ANSWER

By brute force, if order of parentheses matter ( i.e. expression like $(8+8)+8$ is considered to be distinct from $8+(8+8)$), I have counted $623$ solutions.

Since I don't have a clean cut criterion to tell which solutions are equivalent when we unwind the parentheses, I cooked up some ad hoc hash function to classify the $623$ solutions. Under this classification, solutions with different number of operators are considered to be distinct. The result is a list of $23$ expressions.

To proceed further, we replace the appearance of $8, 88, 888, 8888$ in these expressions by 4 variables $x_1, x_2, x_3, x_4$ and ask an CAS to simplify them. Based on the result, we split the $23$ expressions into $7$ groups.

(x4-x3)/x1
1   #  ( ( 8888 - 888 ) / 8 )

((x1+1)*x3+x1)/x1
2   #a ( ( ( 8 + 888 ) / 8 ) + 888 )
3   #b ( ( ( 888 * ( ( 8 / 8 ) + 8 ) ) + 8 ) / 8 )

x3+x2+3*x1
4   #  ( 8 + ( 8 + ( 8 + ( 88 + 888 ) ) ) )

x3+2*x1^2-2*x1
5   #a ( 888 + ( ( 8 * ( 8 + 8 ) ) - ( 8 + 8 ) ) )
6   #a ( 888 - ( ( 8 - ( 8 * ( 8 + 8 ) ) ) + 8 ) )
7   #a ( ( 888 - 8 ) - ( 8 - ( 8 * ( 8 + 8 ) ) ) )
8   #b ( 888 + ( ( 8 - ( 8 / 8 ) ) * ( 8 + 8 ) ) )
9   #b ( 888 - ( ( ( 8 / 8 ) - 8 ) * ( 8 + 8 ) ) )

-x2+2*x1^3+x1^2
10  #a ( ( ( 8 * 8 ) - 88 ) + ( 8 * ( 8 * ( 8 + 8 ) ) ) )
11  #a ( ( 8 * 8 ) - ( 88 - ( 8 * ( 8 * ( 8 + 8 ) ) ) ) )
12  #b ( 8 * ( ( 8 - ( 88 / 8 ) ) + ( 8 * ( 8 + 8 ) ) ) )
13  #b ( 8 * ( 8 - ( ( 88 / 8 ) - ( 8 * ( 8 + 8 ) ) ) ) )

(4*x1^3-x1^2+2*x1)/2
14  #  ( ( 8 * ( 8 * ( ( 8 - ( 8 / ( 8 + 8 ) ) ) + 8 ) ) ) + 8 )
15  #  ( ( 8 * ( 8 * ( 8 - ( ( 8 / ( 8 + 8 ) ) - 8 ) ) ) ) + 8 )
16  #  ( 8 - ( 8 * ( 8 * ( ( ( 8 / ( 8 + 8 ) ) - 8 ) - 8 ) ) ) )

2*x1^3-3*x1
17  #a ( ( 8 * ( ( 8 * 8 ) + ( 8 * 8 ) ) ) - ( 8 + ( 8 + 8 ) ) )
18  #a ( ( ( ( 8 * ( ( 8 * 8 ) + ( 8 * 8 ) ) ) - 8 ) - 8 ) - 8 )
19  #a ( ( ( 8 * ( ( 8 * 8 ) + ( 8 * 8 ) ) ) - 8 ) - ( 8 + 8 ) )
20  #b ( ( ( ( 8 * 8 ) - ( ( 8 + 8 ) / 8 ) ) * ( 8 + 8 ) ) + 8 )
21  #b ( ( ( ( 8 * ( 8 + 8 ) ) - ( 8 / 8 ) ) * 8 ) - ( 8 + 8 ) )
22  #c ( ( ( 8 - ( 8 / ( 8 * 8 ) ) ) * ( 8 * ( 8 + 8 ) ) ) - 8 )
23  #d ( ( ( 8 - ( ( 8 / 8 ) / 8 ) ) * ( 8 * ( 8 + 8 ) ) ) - 8 )

Expressions in different group are definitely in-equivalent. Within a group, some expressions looks so different, we should really treat them as distinct. e.g.

  • expression 2 and 3 above has different number of variables
  • expression 7 doesn't involves division while expression 8 does.

Once again, I have to emphasis I don't have a clean cut criterion to tell which expressions are equivalent. I will leave the 23 expressions as is and let you make your own judgement.

0
On

Are there others

Yes :

$$1000=(8\cdot 8\cdot 8-8)\cdot (8+8)/8-8$$

Added :

$$1000=(8+8)\cdot (8\cdot 8-(8+8)/8)+8$$