25
$\begingroup$

Make the number 1998 using the minimum amount of digits 8.

Your allowed operations are +, -, *, /, ^, % (percent).

You need not use only integers 8: 88 and the likes are acceptable.

You must only use 8 as a digit, nothing else.

This puzzle comes from an old friend's school DMs. He said the best that could be done was 10, so I'm turning to the community to see if you can do it better.

Have fun.

$\endgroup$
14
  • $\begingroup$ Can we write two eights together to make 88? $\endgroup$
    – Bass
    Commented Sep 11, 2019 at 17:02
  • $\begingroup$ @Andrew Viola! We have got it with 9 8's (by @HerbWolfe) $\endgroup$ Commented Sep 11, 2019 at 17:31
  • 2
    $\begingroup$ @Quark-epoch I got a nine-$8$ solution around 15 minutes before Herb Wolfe :-) $\endgroup$ Commented Sep 11, 2019 at 17:58
  • 2
    $\begingroup$ Adding concatenation really does change the question. $\endgroup$
    – Ben Barden
    Commented Sep 11, 2019 at 18:31
  • 1
    $\begingroup$ @Deusovi - Also, if so, then my answer should probably go too, because I do not have a proof of optimality either. I searched a pretty large set of expressions, but there's an infinity of possibilities and the data types used don't fare so well with extreme numbers. There was already one answer (with 1875 % signs) that would be impossible for my code to find. $\endgroup$
    – Vilx-
    Commented Sep 13, 2019 at 7:35

12 Answers 12

32
$\begingroup$

Found a solution with 8 eights, using concatenation and finally finding some use for the percent sign:

$$\frac{88 + 8\times8 +8 -8\% -8\%}{8\%}$$ $$ = \frac{88 + 64 + 8 -.08 -.08}{.08} = \frac{160}{.08} - \frac{.08}{.08}- \frac{.08}{.08} = 160*12.5 -2 = 1998$$

EDITED (much later..): Found another, without concatenation this time:

$$8 \times (8+8) \times (8+8) - \frac{8}{8\%+8\%} $$ $$ = 8\times16\times16 - \frac{8}{.16} = 2048 - 50 = 1998 $$

$\endgroup$
10
  • 2
    $\begingroup$ @Adam, I totally stole the way to make the 50 from your post, the unusual use of the parens and the percent sign caught my eye, and I realised you had invented a totally brilliant way of creating the 50 I remembered desperately needing an hour ago. (The upvote on your answer is mine, more would definitely be in order.) $\endgroup$
    – Bass
    Commented Sep 11, 2019 at 19:48
  • 5
    $\begingroup$ At the time this comment was sent, there were 8 upvotes on the question, 8 upvotes on the answer, 8 8's used to create this answer, and 8 answers. $\endgroup$
    – sunfishho
    Commented Sep 11, 2019 at 22:14
  • 2
    $\begingroup$ You did it. You're a legend. $\endgroup$
    – Andrew
    Commented Sep 12, 2019 at 13:02
  • 1
    $\begingroup$ @Andrew Oh, you flatter me. I'm not a legend, I'm only epic. :-) $\endgroup$
    – Bass
    Commented Sep 12, 2019 at 13:42
  • 8
    $\begingroup$ @Deusovi sorry, but how exactly do you think such a proof can be accomplished??? I literally do not think such a proof (in the mathematical sense) is possible given the infinitude of possibilities. $\endgroup$
    – YiFan
    Commented Sep 13, 2019 at 12:48
20
$\begingroup$

OK, so I took a different approach. Seeing as I couldn't come up with anything interesting, I decided - f-it, let's make the computer try! And wrote a little program that tries all the possibilities. The code can be found here on PasteBin.

There are two things of note about the % operator:

  • I treated it as an unary operator which divides by 100. So it can be stacked too: (8+8)%% = 0.0016
  • Since you can potentially add as many % operators as you want to a single operand, I had to put in some kind of limit. Initially I set it to max 3 % operators in a row, but later changed to 1 to make it faster.

With that in mind the results are...

I couldn't find any expressions with 6 8s or less. But with 7 8s they started coming in. Here's one:

$$ 8+\frac{8+8-8\%}{(88-8)\%\%}=8+\frac{15.92}{0.008}=8+1990=1998$$

The total results for 7x8 with no more than 1 % in a row are below. They are all in Polish Notation because that was easier for me to produce. Converting them to "normal" notation is straightforward, but tedious, so I'll leave that to someone else. :)

+ 8/+ 8- 8% 8%-% 88% 8
+ 8/-+ 8 8% 8%-% 88% 8
- 8/-% 8+ 8 8%-% 88% 8
+ 8/- 8-% 8 8%-% 88% 8
+ 8/+- 8% 8 8%-% 88% 8
- 8/--% 8 8 8%-% 88% 8
+/+ 8- 8% 8%-% 88% 8 8
+/-+ 8 8% 8%-% 88% 8 8
+/- 8-% 8 8%-% 88% 8 8
+/+- 8% 8 8%-% 88% 8 8
+/-% 8+ 8 8%-% 8% 88 8
+/--% 8 8 8%-% 8% 88 8
- 8/+ 8- 8% 8%-% 8% 88
- 8/-+ 8 8% 8%-% 8% 88
+ 8/-% 8+ 8 8%-% 8% 88
- 8/- 8-% 8 8%-% 8% 88
- 8/+- 8% 8 8%-% 8% 88
+ 8/--% 8 8 8%-% 8% 88

Note: I've checked all formulas with 6x8 and up to 2 % signs in row and didn't find anything. I also checked all 5x8 with up to 3 % signs in row. No results. However this doesn't prove that it's impossible to do with 6 or less 8. This only means that my code cannot find such combinations because it's beyond what it is capable of. The double data type does have its limits, and Legorin showed that you can have a legit answer with 1875 % signs in row (which is awesome, by the way). The code could be further improved to both increase accuracy and speed, but I've already wasted enough time on it as it is. If you want to give it a go, be my guest! :)

$\endgroup$
10
  • $\begingroup$ Impressive code. Did you try every possibility, so you could rule out the possibility of using less than 8 8s? $\endgroup$ Commented Sep 12, 2019 at 17:27
  • $\begingroup$ Wait, you didn't include any exponent, did you? $\endgroup$ Commented Sep 12, 2019 at 17:30
  • $\begingroup$ @EricDuminil - I added exponent and moved from float to double. That's a pretty serious performance hit, so I'm still waiting for results. There was nothing with 6x8, but 7x8 is taking a good while. $\endgroup$
    – Vilx-
    Commented Sep 12, 2019 at 20:31
  • $\begingroup$ @EricDuminil - Aaaand done! We have solutions with 7x8! However they all seem to depend on "percentalizing" subresults. I guess that's acceptable? $\endgroup$
    – Vilx-
    Commented Sep 12, 2019 at 20:36
  • 1
    $\begingroup$ @EricDuminil - OK, final results. 6x8 with 2x% didn't yield any results. $\endgroup$
    – Vilx-
    Commented Sep 12, 2019 at 22:15
15
$\begingroup$

I have a solution with 12 8s

$((8+8) \times (8+8) \times 8) - (8\times8) + (8+8) - \frac{8+8}{8}$

Updated, another with 9 8s

$\frac{8888-8}{8} + 888$

$\endgroup$
3
  • 1
    $\begingroup$ I added some maths formatting - hope you don't mind :-) $\endgroup$ Commented Sep 11, 2019 at 17:09
  • 1
    $\begingroup$ Ooh, nice: your nine-8 solution is a polished version of my ten-8 one. $\endgroup$ Commented Sep 11, 2019 at 18:11
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:27
15
$\begingroup$

I found another solution with 8.

$$(\frac{8}{8\%\%...\%\%}^{8\%\%} - \frac{8}{8})\frac{8+8}{8}=1998$$

the %%...%% is 1875 % symbols

$$\%=\frac{1}{100}$$ $$8\%\%=\frac{1}{1250}$$ $$\frac{8}{8\%\%...\%\%}=1000^{1250}$$

therefore

$$\frac{8}{8\%\%...\%\%}^{8\%\%} = 1000$$ $$1000 - \frac{8}{8} = 999$$ $$999(\frac{8+8}{8})=1998$$

$\endgroup$
5
  • $\begingroup$ By far the most amazing answer (+1) $\endgroup$
    – Adam
    Commented Sep 12, 2019 at 18:30
  • $\begingroup$ you can also do 8/((88-8)%%) to get 1000 but thats less fun and 4 8s $\endgroup$
    – Legorhin
    Commented Sep 12, 2019 at 23:16
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:28
  • $\begingroup$ Can we get the number of percent symbols up to 1998, while still producing the number 1998? $\endgroup$ Commented Sep 13, 2019 at 14:04
  • $\begingroup$ Actually, yes, you can. Both 8/8 and (8+8)/8 allow you to add as many % symbols as you like, as long as you do it symmetrically to both sides of the fraction. So 8/8=8%/8%=8%%/8%%=... and (8+8)/8=(8%+8%)/8%=.... Using this you can get up to 1998 % in total. $\endgroup$
    – Vilx-
    Commented Sep 13, 2019 at 20:53
13
+500
$\begingroup$

Here is a hilarious solution for 9

$(\frac{8+8}{8})^{\frac{88}{8}}-\frac{8}{(8+8)\%}=1998$

For research purposes I'll also include my kinda illegal solution for 7

$\frac{8+8}{8}(\frac{8}{.8\%}-\frac{8}{8})=1998$

$\endgroup$
4
  • 1
    $\begingroup$ You won... if we include the dot. I didn't allow the dot to be used but nice work still. $\endgroup$
    – Andrew
    Commented Sep 11, 2019 at 19:21
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:27
  • 1
    $\begingroup$ Your second solution can be reduced to 6: $\dfrac{8+8}{.8\%}-\dfrac{8+8}{8}=1998$ $\endgroup$
    – Nilster
    Commented Dec 10, 2020 at 14:11
  • 2
    $\begingroup$ @Nilster Why stop there? $\frac {8+8-.8\%-.8\%}{.8\%}$ $\endgroup$ Commented Dec 11, 2020 at 14:12
9
$\begingroup$

A solution with nine $8$s:

$$\frac{88+(8\times8)+8}{8\%} - \frac{8+8}{8}$$

i.e.

$1100 + 800 + 100 - 2$, taking advantage of the fact that $\%$ is an allowed operation.

A very simple solution with ten $8$s (which I'm surprised nobody else has done):

$$\frac{8888}{8} + 888 - \frac{8}{8}$$

$\endgroup$
7
  • $\begingroup$ I saw this puzzle on a site and thought to ask this SE about it. The given solution on the site had ten 8s, so this is technically an improvement. Nice work, Rand! $\endgroup$
    – Andrew
    Commented Sep 11, 2019 at 17:10
  • $\begingroup$ Wow! I was expecting this to be still not optimal, since in a previous comment you mentioned eight 8s. $\endgroup$ Commented Sep 11, 2019 at 17:11
  • $\begingroup$ Well... I misremembered. It was not a real site. It was a DM with a friend in school. I'll make sure to mention this in an edit. $\endgroup$
    – Andrew
    Commented Sep 11, 2019 at 17:15
  • $\begingroup$ I didn't see your solution with 10, but I added a similar one with 9 8s. $\endgroup$
    – Herb
    Commented Sep 11, 2019 at 17:23
  • 2
    $\begingroup$ the reason no one had done the "very simple solution" was that things like 88, 888, etc were not declared as permissible until relatively shortly before your answer. $\endgroup$
    – Ben Barden
    Commented Sep 11, 2019 at 18:33
7
$\begingroup$

Here's a solution with $9$ eights, without using the % operator:

$$ \frac{888}{8} ( 8+8 + \frac{8+8}{8}) = 111*18=1998$$

$\endgroup$
1
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:28
6
$\begingroup$

Thanks to a comment from Ben Barden, here is another way of achieving 11 8s

$8+8+\left(\left(\frac{8+8}{8}\right)^8 - 8\right)\times 8-\frac{8+8}{8}$

$\endgroup$
6
  • $\begingroup$ If someone got 8 8s that'd be cool. $\endgroup$
    – Andrew
    Commented Sep 11, 2019 at 16:44
  • $\begingroup$ you could pull the same trick I did, and shave it down to 11 as well. $\endgroup$
    – Ben Barden
    Commented Sep 11, 2019 at 16:52
  • $\begingroup$ @BenBarden Thanks, totally missed that factorisation, +1 for you. $\endgroup$
    – hexomino
    Commented Sep 11, 2019 at 16:54
  • $\begingroup$ ...and +1 back for being the originator of my solution's ancestor. $\endgroup$
    – Ben Barden
    Commented Sep 11, 2019 at 16:56
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:28
4
$\begingroup$

My first try, with ten:

$\frac{8888}{8} + 888 - \frac{8}{8}$

Only 4 operators

$\endgroup$
4
  • $\begingroup$ This one is already in my answer. Nice one though! $\endgroup$ Commented Sep 11, 2019 at 18:03
  • $\begingroup$ Thanks! Similarly, I’ve just got another solution which I found was already posted by another user. Such is the game! $\endgroup$ Commented Sep 11, 2019 at 18:09
  • $\begingroup$ @Brandon_J what makes you say that? I see no connection to Rubio whatsoever! $\endgroup$
    – Adam
    Commented Sep 11, 2019 at 19:47
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:28
3
$\begingroup$

Stealing gloriously from the work of others, I have it down to 11:

$(((8+8) \times (8+8) - 8) \times 8) + (8+8) - \frac{8+8}{8}$

$\endgroup$
2
  • $\begingroup$ I added some maths formatting - hope you don't mind :-) $\endgroup$ Commented Sep 11, 2019 at 17:10
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:28
2
$\begingroup$

If you allow concatenation of intermediate results (not just the original $8$s), here's a solution with $7$ eights:

$$\frac{888}{8}*\left(\frac88 8 \right)$$ The concatenation $\left(\frac88 8 \right)$ works out to $18$.

$\endgroup$
4
  • $\begingroup$ If concatenation is not specified, would the assumed result of the equation in your parenthesis not be 8 (i.e. 8/8*8 = 8)? I think concatenation is usually denoted with || i.e. 8/8||8 - Although I stand to be corrected! $\endgroup$
    – Frits
    Commented Sep 12, 2019 at 9:53
  • $\begingroup$ You literally stole this answer from trolley813's comment $\endgroup$
    – Adam
    Commented Sep 12, 2019 at 10:18
  • $\begingroup$ @Adam I didn't see the comment. So you may consider it "stealing", but I came up with it independently. Nevertheless, thanks for pointing it out. I will delete my answer. $\endgroup$
    – paw88789
    Commented Sep 12, 2019 at 11:04
  • $\begingroup$ If you allow that you can do much better: $\frac{8+8-8\%}{8\%}||8$ $\endgroup$ Commented Dec 12, 2020 at 2:29
1
$\begingroup$

Straightforward solution with 9 8s:

$(\frac{88 - 8}{8} + 8) \times (\frac{888}{8})$

$\endgroup$
1
  • $\begingroup$ Based on the rules established by this meta post and the consensus around it, an answer must have justification for why the solution is optimal. Without that, this is a comment, not an answer. $\endgroup$
    – Deusovi
    Commented Sep 13, 2019 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.