Problem

Source: Baltic Way 2020, Problem 16

Tags: number theory, number theory proposed, modular arithmetic



Richard and Kaarel are taking turns to choose numbers from the set $\{1,\dots,p-1\}$ where $p > 3$ is a prime. Richard is the first one to choose. A number which has been chosen by one of the players cannot be chosen again by either of the players. Every number chosen by Richard is multiplied with the next number chosen by Kaarel. Kaarel wins the game if at any moment after his turn the sum of all of the products calculated so far is divisible by $p$. Richard wins if this does not happen, i.e. the players run out of numbers before any of the sums is divisible by $p$. Can either of the players guarantee their victory regardless of their opponent's moves and if so, which one?