3
$\begingroup$

I was playing around with the code for my game the other day in an effort to create some unique effects. One thing I created was what I called an "ignorant assignment" in which I applied arithmetic with complete disregard for the traditional order of operations so that the order of operations is sequential (e.g. applied in the visually presented order). Here are two simple examples and their expected outcomes:

$$1 + 3 \cdot 5 \div 2 + 1 = 11$$ $$-1 + 3 \cdot 5 \div 2 + 1 = 6$$

Using only the numbers $1$ through $9$ (to include their negative counterparts) and the foundational operations of addition ($+$), subtraction ($-$), multiplication ($\cdot$), and division ($\div$), what is the optimal [1] "ignorant assignment" so that each step of the evaluation process will output each of the numbers $0$ through $15$ no more than once? [2]


There are, of course, some rules that must be followed:

  • Two of the same digit may not follow each other (e.g. $1 + 1$ is not allowed).
  • Concatenation is not allowed (e.g. you cannot combine $1$ and $2$ to create $12$).
  • The numbers $1$ through $9$ may be used no more than thrice each.

1: For the purposes of this puzzle, optimal means using the least instances of the same digit (e.g. use each digit as few times as possible); along with having the lowest sum.
2: The order of the output doesn't matter.

$\endgroup$
3
  • $\begingroup$ Hoping this isn't too easy, it took me a while to find what I considered a decent balance. $\endgroup$ Nov 2, 2021 at 18:47
  • $\begingroup$ Does inputting a 5 as the first digit count as 5 being output? $\endgroup$
    – Bass
    Nov 2, 2021 at 19:39
  • $\begingroup$ @Bass that's a fair question, but no. A step in the context of this puzzle is defined as performing a mathematical operation (e.g. $5 + 1 - 3 = 3$ in two steps of $5 + 1 = 6 - 3 = 3$). As such, the first step outputs $6$ and the second outputs $3$. $\endgroup$ Nov 2, 2021 at 19:49

1 Answer 1

6
$\begingroup$

According to the two constraints we're given (fewest repetitions of any digit and lowest sum), a theoretical ideal solution should

use the digits from 1 to 8 twice each and 9 once, a total of 17 numbers, as there are 16 steps.

Here's a solution that achieves this:

8 + 3 - 5 + 7 + 1 / 7 * 6 / 4 + 6 - 2 + 8 - 5 - 9 - 1 + 4 * 2 - 3
11 6 13 14 2 12 3 9 7 15 10 1 0 4 8 5

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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