Someone told me about this game a long time ago. Pick any four digits, such as 0, 2, 4 and 9. Furthermore, pick a target number between 1 and 100, such as 61. Your goal is to find a mathematical expression that uses each of the four digits exactly once and evaluates to the target number. In our example, one solution is:
\(61 = 9^{\sqrt{4}} - 20\)
You can use all basic arithmetic operations, roots, factorial, logarithms and whatever other operations you like. You can also combine several digits into a multi-digit number. Try it out, just randomly choose four digits and a target! And in case you need a challenge, try the digits 0, 0, 0 and 2 with target 71.
You might be wondering whether there always is a solultion to this puzzle, no matter which four digits and target number you picked. Well, the answer is probably no, just think of the case where the four digits are all zeros. But surprisingly, if you choose the four digits and target number at random, the chance for a solution to exist is very high. I rarely encountered cases without a solution.
To find out which cases have a solution and which do not, I wrote a program that systematically searches for solutions. Here are all the solutions it found. If you find a solution that is not in this list, please let me know!