# How to get 5 from the numbers {6, 7, 8, 9} using only addition, subtraction, division, and multiplication.

Is there a way you can get the number 5 from the numbers 6, 7, 8, and 9 using only addition, subtraction, multiplacation, and division, without combining two numbers e.g. using the 6 and 7 to create 67. Exponents, factorials, and trig functions are not allowed. If there is no way to do this, is there a way to prove that it is impossible? Thanks if you answer.

• Clearly nonunique. – Oscar Lanzi Jul 2 '19 at 13:43

## 4 Answers

$$\frac{8\times9}{6}-7$$

That seems about right!

$$===================(7+8)/(9-6)$$.

The code in my answer to your other question gives one more solution (after curating the output by hand)

7*(8-6)-9=5 (Bruno's solution)
(7+8)/(9-6)=5.0 (Oscar's solution)
8-6/(9-7)=5.0
8/6*9-7=5.0 (Zach's solution)

• (PS because the code performs an exhaustive search, this is all the solutions) – Calvin Khor Jul 4 '19 at 0:32
• Did you write the cases manually, or did you iterate over a list of functions? In second case, could I see the code? – Sudix Jul 5 '19 at 1:13
• @Sudix You may indeed see the code, its in the linked answer (you just need to change the 6 to a 5 (also I think you don't lose any solutions to floating point errors)) – Calvin Khor Jul 5 '19 at 1:43
• @Sudix (and remove the break points) – Calvin Khor Jul 5 '19 at 1:53

here is one other way to do it:

$$(8-6)\cdot 7 - 9 = 5$$

• @TheCount $(8-6)\cdot 7 - 9 = 2\cdot 7 - 9 = 14 - 9 = 5$. How this does not provide an answer? It's a direct answer since it's an elementary math problem. Do I need to explain more than the expression I wrote? – Bruno Reis Jun 30 '19 at 1:22
• FYI, that comment is a formatted thing that happens automatically by clicking. I probably did it by mistake, since this is definitely an answer to the question. Will delete. – The Count Jun 30 '19 at 2:24
• @TheCount Oh, no problem mate. Thanks! – Bruno Reis Jun 30 '19 at 3:45