This is just for fun and inspired by Estimating pi, using only 2s.
For a positive integer $n$, let $f(n)$ denote the minimum number of $2$s needed to express $n$ using addition, subtraction, multiplication, division, and exponentiation, together with the ability to concatenate $2$s, so for example $2 \times 22^2 + \frac{222}{2}$ is a valid expression. Other variants involving different sets of allowed operations are possible, of course. This function is very far from monotonic, so to smooth it out let's also consider
$$g(n) = \text{max}_{1 \le m \le n} f(m).$$
For example,
- $f(1) = 2$ ($1 = \frac 22$)
- $f(11) = 3$ ($11 = \frac{22}{2}$)
Question: What can you say about $f(n)$ and $g(n)$? Can you give exact values for small values of $n$? Can you give (asymptotic or exact) upper bounds? Lower bounds?
As a simple example we can write any positive integer $n$ in the form $2^k + n'$ where $n' < 2^k$ ($2^k$ is just the leading digit in the binary expansion of $n$), which gives $f(n) \le f(k) + 1 + f(n')$. If we write $\ell(n) = \lfloor \log_2 n \rfloor$ then iterating this gives something like
$$g(n) \le \sum_{k=1}^{\ell(n)} \left( g(k) + 1 \right).$$
This gives an upper bound growing something like $\ell(n) \ell^2(n) \ell^3(n) \dots$ which I think is pessimistic. For example, in my answer to the linked question I show that
$$f(14885392687) \le 36$$
and $\ell(14885392687) = 33$ so maybe we can expect something as good as $g(n) = O(\log n)$ for an upper bound. I have no idea about a lower bound, other than to write down an upper bound on the number of possible expressions that can be made with a given number of $2$s.
Edit: A related question involving $4$s and more allowed operations: How many fours are needed to represent numbers up to $N$?