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 8
s or less. But with 7 8
s 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! :)
%
signs) that would be impossible for my code to find. $\endgroup$