Numbers of distinct values obtained by inserting $+ - \times \div ()$ in $\underbrace{2\quad2 \quad2 \quad2\quad...\quad 2}_{n \text{ times}}$

Solution 1:

It looks like we can do this "inductively": for the calculations of size $n$, we can take values from the list for $1 \le k\le n/2$, and values from the list for $(n-k)$, and operate on them using the 64 different operation orders.

Fortunately, it's really only 10 classes of operation, because many are duplicates:

  • There's four values we can get from addition and subtraction: $a+b$, $-(a+b)$, $a-b$, and $b-a$.
  • There's only two we can get from multiplication: $ab$ and $-ab$.
  • There are four cases we can get from division: $a/b$, $b/a$, $-a/b$, and $-b/a$.

Also conveniently we only need to try the nonnegative entries in previous lists.

So for $n=4$, we have:

$-16$, $-12$, $-10$, $-8$, $-6$, $-5$, $-4$, $-3$, $-5/2$, $-2$, $-3/2$, $-1$, $-2/3$, $-1/2$, $-1/3$, $-1/4$, $0$, $1/4$, $1/3$, $1/2$, $2/3$, $1$, $3/2$, $2$, $5/2$, $3$, $4$, $5$, $6$, $8$, $10$, $12$, $16$

Which is $33$ entries.

I've written a short script which finds them all, and told it to run up to $n=10$, which gave the following sizes: $2,5,13,33,77,185,441,1051,2523,6083$. Apparently this sequence is not in OEIS, nor is the positive-values-only version! I am very surprised.

Solution 2:

@Dan Uznanski if your results are correct i noticed that the ratio between the successive terms of the sum is almost constant. So maybe:

Conjecture

$$D(n) \sim K^n $$

Where:

$$2.3\leq K \leq 2.5 $$