# Number merging game

You are given a grid filled with numbers. If a number $$n$$ is orthogonally adjacent (horizontally or vertically) to another number $$n$$ then you can pick it up and place it on top of the second number. When you do that, the two numbers will merge into $$n+1$$ and the original cell will become empty. Starting with the following grid, can you make a series of moves to obtain a single number?

• I know that there is a solution, but I don't know if it is unique. Jan 5, 2022 at 4:26
• Was kind of hoping it wasn't possible and that there would be some kind of parity proof for it. But no, it all checks out. There's 6 ones, which is even. Becomes 3 2's with 7 2's on board for a total of 10 which is even. That becomes 5 3s combined with the existing 3 3s gives 8 3s which is a power of 2, therefore it can in theory collapse to a single number as long as you don't blunder and leave gaps Jan 5, 2022 at 14:32

## 3 Answers

There are 2x2 solutions.

In the picture below, each column represents a solution that leads to a pair of fives, and each pair of fives can be resolved in 2 ways (depending on which 5 you move on the other 5).

In the first row, the red arrows show the first moves that merge the 1s into 2s, the blue arrows show the second moves to merge the 2s into 3s. In the second row, the red arrows merge the 3s into 4s and the blue arrows merge the 4s into 5s.

I'll update this answer later with my reasoning which proves these are the only solutions.

• Ah, it's merging the 2's where things are not unique. Although their pairing is unique, the direction is not. Well spotted! Jan 6, 2022 at 9:19

I believe I can do it:

First, we realise that all the ones will merge into 2's where the 2's will merge into 3's and etc. So, we first merge the 1's in a way that the 2 created touches another 2, so we can make it into 3.

So first, the original picture:

To:

With highlighted numbers that we just created.

From there:

We realise that the remaining 2 2's on the right most column needs to merge leftwards, as if not we will create 2 3's isolated on the 4th column. So:

Lastly:

And from there, we connect all the remaining 4's:

In

I believe 5 moves.

• This also makes it easy to check that the solution is unique except for the ordering of independent moves. Jan 5, 2022 at 9:34
• I'm not sure the justification for the first step is rigorous. Every direction you can merge the 1s into 2s will have the 2s touching other 2s. The solution may still be unique, but I don't think as presented that that conclusion is justified here @JaapScherphuis Jan 5, 2022 at 14:41
• @Cruncher The uniqueness of the first step isn't obvious, until you realise that after the step is finished, every cluster of contiguous twos must be of even size. In particular the twos in the bottom-left corner cannot remain isolated, and after that the direction of the other merging of the ones is also forced. Jan 5, 2022 at 17:01
• The solution is not unique even ignoring move reordering... Jan 5, 2022 at 18:41
• I added them as an answer. Jan 6, 2022 at 8:43

Should be quite self-explanatory.

• The order on the moves isn't strict. The only thing that matters is that boxes that both have in arrows and out arrows, have the in arrows performed first Jan 5, 2022 at 14:37
• @Cruncher But e.g. in the lower right corner, we have a 1 which has two in-arrows from 1 and 2. It is important that the arrow from 1 is performed first. I added the numbers in order to avoid any possible ambiguity. Jan 5, 2022 at 14:57
• I think that disambiguates itself because obviously you can't make illegal moves. That is, given only the arrows as long as your next move doesn't take an out arrow while in arrows are still available, and the move is legal, it will be a part of the same solution set. But anyway, including the numbers does help it to be clear in any case :) Jan 5, 2022 at 14:59