Problem

Source: USA TSTST 2018 Problem 7

Tags: combinatorics, Tstst, USA



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: The frog visits only points in $\{1, 2, \dots, 2^n-1\}$, each at most once. 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$? Ashwin Sah