← RoseCode

ROSECODE 341

Unreachable numbers

Philippe_57721 · Programming ·

Using four numbers 4 and the 4 operations +, -, *, / we can build all numbers up to 9.
  • 1 = ((4 + 4) - 4) / 4
  • 2 = (4 / (4 + 4)) * 4
  • 3 = ((4 + 4) + 4) / 4
  • 4 = ((4 - 4) * 4) + 4
  • 5 = ((4 * 4) + 4) / 4
  • 6 = ((4 + 4) / 4) + 4
  • 7 = (4 - (4 / 4)) + 4
  • 8 = ((4 + 4) + 4) - 4
  • 9 = ((4 / 4) + 4) + 4
  • 12 = (4 - (4 / 4)) * 4
10 is the first not reachable

With four numbers 5
  • 1 = ((5 + 5) - 5) / 5
  • 2 = (5 / 5) + (5 / 5)
  • 3 = ((5 + 5) + 5) / 5
  • 4 = ((5 * 5) - 5) / 5
  • 5 = ((5 - 5) * 5) + 5
  • 6 = ((5 * 5) + 5) / 5
  • 7 = ((5 + 5) / 5) + 5
  • 9 = (5 - (5 / 5)) + 5
8 is the first not reachable

What are the first unreachable numbers when we use eight 4 and eight 5?

Answer format: u4,u5

Example: 10,8

[My timing: 40 sec]