# Make 1998 using the least possible digits 8

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.

• Can we write two eights together to make 88?
– Bass
Sep 11 '19 at 17:02
• @Andrew Viola! We have got it with 9 8's (by @HerbWolfe) Sep 11 '19 at 17:31
• @Quark-epoch I got a nine-$8$ solution around 15 minutes before Herb Wolfe :-) Sep 11 '19 at 17:58
• Adding concatenation really does change the question. Sep 11 '19 at 18:31
• @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. Sep 13 '19 at 7:35

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$$

• @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.)
– Bass
Sep 11 '19 at 19:48
• 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. Sep 11 '19 at 22:14
• You did it. You're a legend. Sep 12 '19 at 13:02
• @Andrew Oh, you flatter me. I'm not a legend, I'm only epic. :-)
– Bass
Sep 12 '19 at 13:42
• @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. Sep 13 '19 at 12:48

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! :)

• Impressive code. Did you try every possibility, so you could rule out the possibility of using less than 8 8s? Sep 12 '19 at 17:27
• Wait, you didn't include any exponent, did you? Sep 12 '19 at 17:30
• @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. Sep 12 '19 at 20:31
• @EricDuminil - Aaaand done! We have solutions with 7x8! However they all seem to depend on "percentalizing" subresults. I guess that's acceptable? Sep 12 '19 at 20:36
• @EricDuminil - OK, final results. 6x8 with 2x% didn't yield any results. Sep 12 '19 at 22:15

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$$

• I added some maths formatting - hope you don't mind :-) Sep 11 '19 at 17:09
• Ooh, nice: your nine-8 solution is a polished version of my ten-8 one. Sep 11 '19 at 18:11
• 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.
– Deusovi
Sep 13 '19 at 5:27

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$$

• By far the most amazing answer (+1)
Sep 12 '19 at 18:30
• you can also do 8/((88-8)%%) to get 1000 but thats less fun and 4 8s Sep 12 '19 at 23:16
• 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.
– Deusovi
Sep 13 '19 at 5:28
• Can we get the number of percent symbols up to 1998, while still producing the number 1998? Sep 13 '19 at 14:04
• 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. Sep 13 '19 at 20:53

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$$

• You won... if we include the dot. I didn't allow the dot to be used but nice work still. Sep 11 '19 at 19:21
• 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.
– Deusovi
Sep 13 '19 at 5:27
• Your second solution can be reduced to 6: $\dfrac{8+8}{.8\%}-\dfrac{8+8}{8}=1998$ Dec 10 '20 at 14:11
• @Nilster Why stop there? $\frac {8+8-.8\%-.8\%}{.8\%}$ Dec 11 '20 at 14:12

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

• 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! Sep 11 '19 at 17:10
• Wow! I was expecting this to be still not optimal, since in a previous comment you mentioned eight 8s. Sep 11 '19 at 17:11
• 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. Sep 11 '19 at 17:15
• I didn't see your solution with 10, but I added a similar one with 9 8s.
– Herb
Sep 11 '19 at 17:23
• 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. Sep 11 '19 at 18:33

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

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

• 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.
– Deusovi
Sep 13 '19 at 5:28

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

• If someone got 8 8s that'd be cool. Sep 11 '19 at 16:44
• you could pull the same trick I did, and shave it down to 11 as well. Sep 11 '19 at 16:52
• @BenBarden Thanks, totally missed that factorisation, +1 for you. Sep 11 '19 at 16:54
• ...and +1 back for being the originator of my solution's ancestor. Sep 11 '19 at 16:56
• 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.
– Deusovi
Sep 13 '19 at 5:28

My first try, with ten:

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

Only 4 operators

• This one is already in my answer. Nice one though! Sep 11 '19 at 18:03
• Thanks! Similarly, I’ve just got another solution which I found was already posted by another user. Such is the game! Sep 11 '19 at 18:09
• @Brandon_J what makes you say that? I see no connection to Rubio whatsoever!
Sep 11 '19 at 19:47
• 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.
– Deusovi
Sep 13 '19 at 5:28

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

• I added some maths formatting - hope you don't mind :-) Sep 11 '19 at 17:10
• 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.
– Deusovi
Sep 13 '19 at 5:28

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

• 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! Sep 12 '19 at 9:53
• You literally stole this answer from trolley813's comment
Sep 12 '19 at 10:18
• @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. Sep 12 '19 at 11:04
• If you allow that you can do much better: $\frac{8+8-8\%}{8\%}||8$ Dec 12 '20 at 2:29

Straightforward solution with 9 8s:

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

• 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.
– Deusovi
Sep 13 '19 at 5:28

I can solve with nine 8s.

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

• Permille are not allowed and if they were allowed you could easily do it with 5 8s. Dec 12 '20 at 2:58