Problem

Source: Peru EGMO TST 2019 p4

Tags: Prime number, number theory, game, combinatorics, Sum



Consider the numbers from $1$ to $32$. A game is made by placing all the numbers in pairs and replacing each pair with the largest prime divisor of the sum of the numbers of that couple. For example, if we match the $32$ numbers as: $(1, 2), (3,4),(5, 6), (7, 8),..., (27, 28),(29, 30), (31,32)$, we get the following list of $16$ numbers: $3,7,11,5,...,11,59,7$. where there are repetitions. The game continues in a similar way until in the end only one number remains. Determine the highest possible value from the number that remains at the end.