# 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) – Quark-epoch Sep 11 '19 at 17:31
• @Quark-epoch I got a nine-$8$ solution around 15 minutes before Herb Wolfe :-) – Rand al'Thor Sep 11 '19 at 17:58
• The real question is, what about 8 8s? – Andrew Sep 11 '19 at 17:59
• Adding concatenation really does change the question. – Ben Barden Sep 11 '19 at 18:31

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. – im_so_meta_even_this_acronym Sep 11 '19 at 22:14
• You did it. You're a legend. – Andrew 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. – YiFan 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? – Eric Duminil Sep 12 '19 at 17:27
• Wait, you didn't include any exponent, did you? – Eric Duminil 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. – Vilx- 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? – Vilx- Sep 12 '19 at 20:36
• @EricDuminil - OK, final results. 6x8 with 2x% didn't yield any results. – Vilx- 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 :-) – Rand al'Thor Sep 11 '19 at 17:09
• Ooh, nice: your nine-8 solution is a polished version of my ten-8 one. – Rand al'Thor 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

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. – Andrew 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

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) – Adam Sep 12 '19 at 18:30
• you can also do 8/((88-8)%%) to get 1000 but thats less fun and 4 8s – Legorhin 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? – Bjartur Thorlacius 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. – Vilx- Sep 13 '19 at 20:53

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! – Andrew 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. – Rand al'Thor 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. – Andrew 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. – Ben Barden 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. – Andrew Sep 11 '19 at 16:44
• you could pull the same trick I did, and shave it down to 11 as well. – Ben Barden Sep 11 '19 at 16:52
• @BenBarden Thanks, totally missed that factorisation, +1 for you. – hexomino Sep 11 '19 at 16:54
• ...and +1 back for being the originator of my solution's ancestor. – Ben Barden 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! – Rand al'Thor 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! – Certainly not a dog Sep 11 '19 at 18:09
• @Brandon_J what makes you say that? I see no connection to Rubio whatsoever! – Adam 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 :-) – Rand al'Thor 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! – Frits Sep 12 '19 at 9:53
• You literally stole this answer from trolley813's comment – Adam 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. – paw88789 Sep 12 '19 at 11:04

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