Problem

Source: Brazil EGMO TST1 2024 #2

Tags: combinatorics, game, game strategy, Game Theory, Perfect Powers



Let \( m \) and \( n \) be positive integers. Kellem and Carmen play the following game: initially, the number $0$ is on the board. Starting with Kellem and alternating turns, they add powers of \( m \) to the previous number on the board, such that the new value on the board does not exceed \( n \). The player who writes \( n \) wins. Determine, for each pair \( (m, n) \), who has the winning strategy. Note: A power of \( m \) is a number of the form \( m^k \), where \( k \) is a non-negative integer.