Problem

Source: Portugal OPM 2022 p6

Tags: combinatorics, game strategy



Given two natural numbers $a < b$, Xavier and Ze play the following game. First, Xavier writes $a$ consecutive numbers of his choice; then, repeat some of them, also of his choice, until he has $b$ numbers, with the condition that the sum of the $b$ numbers written is an even number. Ze wins the game if he manages to separate the numbers into two groups with the same amount. Otherwise, Xavier wins. For example, for $a = 4$ and $b = 7$, if Xavier wrote the numbers $3,4,5,6,3,3,4$, Ze could win, separating these numbers into groups $3,3 ,4,4$ and $3,5,6$. For what values of $a$ and $b$ can Xavier guarantee victory?