Problem

Source: Serbia JBMO TST 2021

Tags: combinatorics, Game Theory



Two players play the following game: alternatively they write numbers $1$ or $0$ in the vertices of an $n$-gon. First player starts the game and wins if after any of his moves there exists a triangle, whose vertices are three consecutive vertices of the $n$-gon, such that the sum of numbers in it's vertices is divisible by $3$. Second player wins if he prevents this. Determine which player has a winning strategy if: a) $n=2019$ b) $n=2020$ c) $n=2021$