Numbers which can be expressed as arithmetical combinations of the numbers $1$ through $N$

70 Views Asked by At

Let's say a number $M$ is an arithmetical combination of $\{1, 2 \cdots, N\}$ if it can be expressed satisfying the following constraints: the only symbols one can use are $+, \times$, parentheses and the numbers $1$ through $N$ such that no number is repeated more than once.

This is perhaps made more clear with examples. Take $N=5$. Then $M=17 = (3 \times 5) + 2$ is an arithmetical combination of $\{1,2 \cdots ,5\}$. Further, for any $N$ note that $\frac{1}{2}N(N+1)$ and $N!$ are both arithmetical combinations, since they are respectively $\sum_{1 \leq i \leq N} i$ and $\prod_{1 \leq j \leq N} j$. It is also clear that any $1 \leq j \leq N$ is an arithmetical combination, for the trivial fact that you can express $j$ as....just $j$.

It seems to be that the maximum arithmetical combination $M$ is $\frac{3}{2}N!$

The argument for this is as follows. Let us say our goal is to maximize $M$, given the above definition. We can make some strategic observations. For one, it is obviously ideal to use every number from $1$ through $N$. It is never useful to multiply $1$ by anything. It is also clear that the $\times$ operation is preferable to the $+$ operation except when one of operands is $1$, in which case $+$ is preferable. Given this, we will have that our maximal $M$ looks something like $(1 + \prod_{j \in S} j) \prod_{j \in S^c} j$ where $S \subset \{2, 3 \cdots ,N\}$ and nonempty. Now note the general fact that for all $r,s,x,y \in \mathbb{R}_{>0}$, if $rs = xy$ and $r < x$, then $(1+x)y < (1+r)s$. Hence we want $\prod_{j \in S} j$ to be as small as possible. Hence $S = \{2\}$ yielding $\frac{3}{2}N!$.

The problem that I'm interested in is the following. Let $g(N)$ be the smallest positive integer not an arithmetical combination of $\{1,2 \cdots ,N\}$. A natural candidate for $g(N)$ is $\frac{3}{2}N! + 1$. However, this does not quite work. Indeed if $N=4$ consider that $\frac{3}{2}4! - 1 = 35$ fails to be an arithmetical combination of $\{1,2,3,4\}$, so $g(4) \leq \frac{3}{2} 4! - 1= 35$ in this case.

What can we say about $g(N)$? Is there a closed form? Is there an asymptotic estimate (e.g., $g(N) = \Theta(N!)$)?

References to problems similar to this are also welcome. There are many variants of problems like this, with additional operators allowed (like subtraction or exponentiation).

2

There are 2 best solutions below

4
On

Note that any prime number has to be expressible as a sum. With $N=4$ we have

$11=1+4+2\times 3$ and

$13=3 \times 4+1$ and

$17=2+(1+4)\times 3$ and

$19=1+(2+4)\times 3$ but I don't think $23$ can be achieved (or $22$?)

In fact it looks possible to show that $N!-1$ can't be achieved (for large enough $N$).

But on the primes thing, for $N=5$ using only $+$ gets to $15$ and $N!=120$. Examine large primes in the gap - the last operation has to be adding two components. If we take one digit out of the product and add it we can get $121, 62, 43 \dots$, but the numbers we can hit between $62$ and $120$ are quite sparse. Various forms like $(a+b)(c+d)+e$ and $a(b+c)+de$ and $ab(c+d)+e$ and $abc+de$ and $abc+d+e$ and $(a+b+c)d+e$ have to be considered. But if we are adding rather than multiplying the value tends to reduce (except for adding $1$ of course).

0
On

Is there a closed form?

Almost certainly not.

Is there an asymptotic estimate?

We can bound above: the smallest unobtainable number is at most 1 plus the number of distinct obtainable numbers, and the number of distinct obtainable numbers is at most the number of distinct expression trees weighted by the number of ways to fill their leaves. That will get an exponential upper bound.


I calculate the following table for small $N$: $$\begin{array}{c}N & g(N) \\ 1 & 2 \\ 2 & 4 \\ 3 & 10 \\ 4 & 22 \\ 5 & 58 \\ 6 & 233 \\ 7 & 827 \\ 8 & 3359 \\ 9 & 16631\end{array}$$