A game called 2048 is making rounds on social media. I am trying to determine the maximum score attainable for this game. Let's assume WLOG that only 2s are returned (if 4s are possible the max score is doubled).
First, I'll relax some of the rules to create a game, $\mathcal{G}$, that can achieve a score at least as high as the original, 2048 game. A run $R$ of $\mathcal{G}_n$ consists of a sequence of moves $m_1,\ldots,m_k$ which manipulate a multiset, $\mathcal{S}$ of maximum size n. Each $m_i$ is either:
- a put $p$, which inserts a 2 into $\mathcal{S}$, or
- a merge, $\alpha_i$, which replaces two $2^i$ elements from $\mathcal{S}$ with a single $2^{i+1}$ elt.
I allow sequential moves of the same type because 2048 allows multiple merges or no-merge turns. The score of a position is the sum of $\mathcal{S}$.
What is the maximum score possible on a game of order n?
Note: The final position must have only unique values, else a merge and put would be possible in increase score.
I claim it is $\sum_{i=1}^{n} 2^i$, but couldn't come up with any good induction arguments. It's pretty easy to prove that an element $2^k$ is producible in a game $\mathcal{G}_k$, but proving an upper bound for production got a bit hairy, and also doesn't cover the full space.
To start, let's find the largest possible number that can enter the game. And to make life easier, let's work with the log of the numbers.
For a number $n$ to be reachable, the smallest group of blocks to have to exist at at least one time frame must be $n-1, n-2, n-3,...2,2,$ where 2 is a 4 in the game (Since 4's are the largest number that can be generated). That means that to make an n block there must be n-1 free cells.
Therefore, for an $m\times m$ board the largest number can be $m^2 + 1$. With the same reasoning, the maximum board will be filled with $m^2 + 1, m^2, m^2 - 1,...,3,2.$
Each block on the board is made by adding two other blocks. Skipping the calculation, for a block of worth $2^k$, the maximum points made for the block is $(k-1)2^k - 4$. If you observe how the points are being made, this is easily reachable.
Therefore the maximum score that can be made is $-4m^2+\sum_{i=1}^{m^2} i\cdot2^{i+1}$.
To simplify, $\sum_{i=1}^{n} i\cdot 2^{i+1} = (n-1) 2^{n+2} + 4$. This can be proved by induction.
With that, the maximum score is $-4m^2 + (m^2-1)2^{m^2+2}+4 = (m^2-1)2^{m^2+2} - 4(m^2-1) = 4(m^2-1)(2^{m^2}-1)$