15
$\begingroup$

Insert multiplication and division operators and parentheses into the following sequence to make the equation true.

Note that you can combine digits to form numbers, such as 1 and 2 to make 12, or 4 and 5 to make 45, but you can't alter the order of the sequence.

1 2 3 4 5 6 7 8 9 = 1

$\endgroup$
2
  • 9
    $\begingroup$ Doesn't seem to be a duplicate - this requires only multiplication and division, the other allowed any operators. Note that it's super easy with +/- : 1-2+3+4-5-6+7+8-9 = 1 $\endgroup$
    – jhabbott
    Commented Feb 12, 2016 at 23:17
  • 1
    $\begingroup$ Yes, both solutions are nice and elegant twins. Upvoted because it is an excellent exercise for more approaches to attack it. An 8yo can try it, it involves a lot of the arithmetics of numbers (multiplicative world), the twin solutions use a "dissolve in the middle pattern" ($\dots\times 56/7/8\dots$ and/or $\dots /56\times 7\times8\dots$) then for the remained digits $12\times 3/4/9$, and moreover, this is a nice computer programming item, that should appear in the first good informatics manuals for the first classes. $\endgroup$
    – dan_fulea
    Commented Jul 8 at 19:11

2 Answers 2

20
$\begingroup$

$$12 \times (3/4)/56 \times 7 \times 8/9 = 1$$

$\endgroup$
3
$\begingroup$

The following sage code prints all the solutions. (No parenthesis allowed.)

sage: c = cartesian_product([['*', '/', ''] for k in range(8)])
sage: for ops in c:
....:     s = '1{}2{}3{}4{}5{}6{}7{}8{}9'.format(*ops)
....:     if eval(s) == 1:
....:         print(s)
....: 
....: 
12*3/4*56/7/8/9
12*3/4/56*7*8/9
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.