Source: TSTST-2018-P7
Category: Extremal Problems

Problem:
Let $n$ be a positive integer. A frog starts on the number line at $0$. Suppose it makes a finite sequence of hops, subject to two conditions: (i) The frog visits only points in $\{1, 2, \dots, 2^n-1\}$, each at most once. (ii) The length of each hop is in $\{2^0, 2^1, 2^2, \dots\}$. (The hops may be either direction, left or right.) Let $S$ be the sum of the (positive) lengths of all hops in the sequence. What is the maximum possible value of $S$?

Solution:
We claim the answer is $\frac{4^n - 1}{3}$. We first prove the upper bound. Notice that the hop sizes must be in $\{2^0, 2^1, \dots, 2^{n - 1}\}$, since the frog must stay within the bounds of $\{0, 1, \dots, 2^n-1\}$ the whole time and the maximum distance between any two points in this set is $2^n-1 < 2^n$. Let $a_i$ be the number of hops of size $2^i$ the frog makes, for $0\le i\le n - 1$.

**Claim:** For any $k = 1, \dots, n$, we have $a_{n-1} + \dots + a_{n-k} \le 2^n - 2^{n-k}$.

**Proof:** Let $m = n-k$ and consider the positions modulo $2^m$. Call a jump *small* if its length is at most $2^{m-1}$, and *large* if it is at least $2^m$. A small jump changes the residue class of the frog modulo $2^m$, while a large jump does not. Within each fixed residue class modulo $2^m$, there are exactly $\frac{2^n}{2^m}$ points in $\{0, 1, \dots, 2^n-1\}$. Since each point is visited at most once, the frog can make at most $\frac{2^n}{2^m} - 1$ large jumps between points of this same residue class. Summing over all $2^m$ residue classes modulo $2^m$, the total number of large jumps is at most $2^m \left( \frac{2^n}{2^m} - 1 \right) = 2^n - 2^m$. This exactly states that $a_{n-1} + \dots + a_m \le 2^n - 2^m$, proving the claim.

Now, the total distance the frog travels is $S = a_0 + 2a_1 + 4a_2 + \dots + 2^{n-1} a_{n-1}$. We rewrite this using summation by parts. Let $A_k = a_{n-1} + \dots + a_{n-k}$ for $k = 1, \dots, n$, with $A_0 = 0$. Then $a_{n-k} = A_k - A_{k-1}$, and we can express $S$ as:
$$ S = A_n + A_{n-1} \cdot 2^0 + A_{n-2} \cdot 2^1 + \dots + A_1 \cdot 2^{n-2}. $$
Using the bounds $A_k \le 2^n - 2^{n-k}$, we get:
$$ S \le (2^n-2^0) + (2^n-2^1) + 2(2^n-2^2) + \dots + 2^{n-2}(2^n-2^{n-1}). $$
Evaluating this sum yields:
$$ S \le 2^n - 1 + \sum_{k=1}^{n-1} 2^{n-k-1}(2^n - 2^{n-k}) $$
$$ = 2^n - 1 + 2^{2n-1} \sum_{k=1}^{n-1} 2^{-k} - 2^{2n-1} \sum_{k=1}^{n-1} 4^{-k} $$
$$ = 2^n - 1 + 2^{2n-1} \left(1 - 2^{-(n-1)}\right) - 2^{2n-1} \frac{1/4 - 4^{-n}}{3/4} $$
$$ = 2^n - 1 + 2^{2n-1} - 2^n - \frac{2^{2n-1} - 2}{3} $$
$$ = \frac{3 \cdot 2^{2n-1} - 2^{2n-1} + 2 - 3}{3} = \frac{4^n - 1}{3}. $$

It remains to show that equality can hold. One can construct two families of paths such that there are $2^k$ hops of size $2^k$ for every $0\le k\le n - 1$, and the frog visits each point in $\{0, \dots, 2^n - 1\}$ exactly once, starting on $0$ and ending on $x$, for the two values $x\in\{1, 2^n - 1\}$. This achieves the theoretical maximum, completing the proof.

Answer: $\frac{4^n - 1}{3}$

Grading guidelines:
(Partial) 1. Observed that every hop length must be at most $2^{n-1}$ (since all visited points stay in $\{0,1,\dots,2^n-1\}$ and any hop of length $\ge 2^n$ is impossible). 2. Introduced counts $a_i$ of hops of length $2^i$ and derived a nontrivial global restriction on the numbers of “large” jumps using residues mod $2^m$ (e.g. proved for some $m$ that the number of hops with length $\ge 2^m$ is at most $2^n-2^m$). 3. Gave a construction idea that visits each point at most once and achieves total hop-sum $S=\sum_{k=0}^{n-1} 2^{2k}=\frac{4^n-1}{3}$ (or at least correctly constructed a family with $2^k$ hops of size $2^k$ for all $k$), even if the upper bound is not proved. (Almost) 1. Proved the key bound $a_{n-1}+\cdots+a_m\le 2^n-2^m$ for each $m$ (equivalently $A_k\le 2^n-2^{n-k}$), and set up the summation-by-parts expression for $S$ in terms of the $A_k$, but made a localized algebra/summation error when evaluating the final bound. 2. Proved the full upper bound $S\le \frac{4^n-1}{3}$ correctly, but the construction for equality is incomplete (e.g. only described informally, or verified the “visits each point exactly once” property for one endpoint but not the other). 3. Gave both the upper bound method and a matching construction, but left a minor gap in the residue-class argument (such as not justifying why large jumps preserve the residue mod $2^m$, or mishandling the count “$\frac{2^n}{2^m}-1$ per class”), while the rest of the solution is correct.