# Solve this math puzzle using numbers 0-9

The numbers used can only be from 0-9 and can't be used twice. The unused digit needs to be less than 6.

Here's a solution where the "extra tile" is a 4:

Going along the trail from top to bottom: 6,0,3,2,5,9,1,7,8. The individual equations are then:

(6+0)/3=2
2x5=10
10-9=1
8-7=1

(BG): Here is an image:

• Aha, so this is not unique. I've got (0 + 8) / 4 = 2; 2 × 5 = 10; 10 − 7 = 3 and 9 − 6 = 3 with the 1 in the spare tile. – M Oehm Apr 13 '17 at 17:00

There is (ignoring swapping the numbers between parentheses) one more solution.

We know:

The multiplication must be $2\times 5=10$ or $5\times 2=10$
leaving:
$\{0,1,3,4,6,7,8,9\}$

For the second of those options we could do:

$\frac{6+9}3$ or $\frac{7+8}3$ leaving:
$\{0,1,4,7,8\}$ or $\{0,1,4,6,9\}$ respectively
Neither of which may complete the $10-a=b-c=d$ requirement.

While for the first we could do:

$\frac{0+6}3$, $\frac{0+8}4$, $\frac{1+7}4$, $\frac{3+9}6$, $\frac{4+8}6$, $\frac{6+8}7$
leaving:
$\{1,4,7,8,9\}$, $\{1,3,6,7,9\}$, $\{0,3,6,8,9\}$, $\{0,1,4,7,8\}$, $\{0,1,3,7,9\}$, $\{0,1,3,4,7,9\}$ respectively
The solutions to $10-a=b-c=d$ for those, respectively, are:
$\{10-9=8-7=1\}$;
$\{10-9=7-6=1, 10-7=9-6=3\}$;
$\{\}$;
$\{\}$;
$\{\}$;
$\{10-9=4-3=1\}$ < the remaining unstated solution (leaving $0$).

As such all solutions (ignoring swapping the numbers between parentheses) are:

Another solution:

Going along the trail from top to bottom: 0,8,4,2,5,7,3,6,9. 1 is left over.

The individual equations are then:

(0+8)/4=2
2x5=10
10-7=3
9-6=3

• I can add an image if you want? – Beastly Gerbil Apr 13 '17 at 17:26

Another Solution:

extra tile = 3
(8 + 0) / 4 = 2
2 x 5 = 10
10 - 9 = 1
7 - 6 = 1

(BG): Here is an image:

@JonathanAllan is correct. There are only 8 solutions:

(0+6)/3 = 2*5 = 10-9 = 1 = 8-7; [extra 4]
(0+8)/4 = 2*5 = 10-7 = 3 = 9-6; [extra 1]
(0+8)/4 = 2*5 = 10-9 = 1 = 7-6; [extra 3]
(6+8)/7 = 2*5 = 10-9 = 1 = 4-3; [extra 0]


and the additional four that have the first two digits swapped.

• Maybe you should post this as a comment under his answer, instead of repeating what he said. – boboquack Apr 15 '17 at 11:10

I saw this puzzle in the HNQ list and found the combinations that solve the upper section by hand, but then I got lazy, so I wrote this semi-brute force Python script. :) It verifies that the already-posted solutions are the only ones.

This script was written for Python 3, but should also run on Python 2.7, and can easily be modified for older versions.

# d, e must be 2 or 5
de = (2, 5)

# numbers that are still free to use
free = set(range(10)).difference(de)

# Find all combinations that solve the upper section
def upper():
for d, e in (de, de[::-1]):
for c in free:
free1 = free.difference({c})
p = c * d
for a in free1:
b = p - a
if a >= b:
break
if b in free1:
yield a, b, c, d, e

# Find all combinations that solve the lower section
def lower():
for t in upper():
free1 = free.difference(t)
for f in free1:
free2 = free1.difference({f})
i = 10 - f
if i not in free2:
continue
free2.remove(i)
for h in free2:
free3 = free2.difference({h})
g = i + h
if g not in free3:
continue
free3.remove(g)
j = free3.pop()
yield t + (f, g, h, i, j)

for t in lower():
a, b, c, d, e, f, g, h, i, j = t
#print(t, (a + b == c * d), (g - h == i == 10 - f), (j < 6))
fmt = '({}+{})/{}={}x{}=10-{}={}={}-{}, {}'
print(fmt.format(a, b, c, d, e, f, i, g, h, j))


### Solutions

(0+6)/3=2x5=10-9=1=8-7, 4
(0+8)/4=2x5=10-7=3=9-6, 1
(0+8)/4=2x5=10-9=1=7-6, 3
(6+8)/7=2x5=10-9=1=4-3, 0

• Is this really necessary if we already know the answer? – boboquack Apr 15 '17 at 11:09
• @boboquack Well no. Consider that script as a way of verifying that those solutions are correct and that there are no others. – PM 2Ring Apr 15 '17 at 11:32