# Given any $4$ numbers, is there a way to make $24$?

I was playing the game $24$, and I saw that some numbers, such as $5,8,9,10$, could not be multiplied, divided, subtracted, added, etc. by me to get $24$ no matter how hard I tried...

Question: So that got me thinking: Is there a way to tell if a set of $4$ numbers can be manipulated to make $24$?

You can use any operation sign and any operation you would like (meaning you can use $\log$ and derivatives, but using those is probably going to be inefficient).

• Looks like a good problem. (+1) – Jacky Chong Oct 21 '16 at 2:13
• Just a note: your four numbers $5,8,9,$ and $10$ cannot make $24$, so you can stop trying ;) – suomynonA Oct 21 '16 at 2:14
• @JackyChong Yes, I know, it was just a side note – suomynonA Oct 21 '16 at 2:15
• Isn't this just the knapsack problem in disguise? – John Douma Oct 21 '16 at 2:20
• @suomynonA Yeah, don't worry. I gave up right after I posted this problem... – Frank Oct 21 '16 at 2:23

If we are allowed to use the Gamma function:

$$\Gamma(5)\cdot(9-8)^{10} = 24$$

or if we can use the factorial and square root:

$$\left(8^{\frac{10}{5\sqrt{9}}}\right)!$$

I can probably think up some more using other special-ish functions. The way I learned $24$ we could use addition, subtraction, multiplication, division, exponentiation, and square roots (and, of course, parentheses). I'm pretty sure there isn't a way to solve it with only those rules, although I'll keep trying.

Edit: We have

$$\sqrt{\left(8\sqrt{9}\right)^{\frac{10}{5}}} = 24$$

which uses only the "expanded standard" rules. It is the "cleanest" in my opinion of the solutions here.

• Hm... I never learned about Gamma function (I'm only a student) but the factorial and square root solution was interesting! – Frank Oct 21 '16 at 2:28
• @Frank I'm only a student too, but you can never be too studenty to learn interesting math concepts. Also, thanks! The factorial function is usually omitted in $24$, if only for the reason that it becomes the find-$4$ game, but since you said we can use any functions I assumed it was fair game. – Carl Schildkraut Oct 21 '16 at 2:29
• $\Gamma (n) = (n-1)!$ for $n = 1,2,3,4,\ldots$ – user144221 Oct 21 '16 at 2:32
• @Frank I just found a "cleaner" solution - see my edit. – Carl Schildkraut Oct 21 '16 at 2:57