Problem

Source: Iberoamerican 2022, Day 1, P2

Tags: number theory



Let $S=\{13, 133, \cdots\}$ be the set of the positive integers of the form $133 \cdots 3$. Consider a horizontal row of $2022$ cells. Ana and Borja play a game: they alternatively write a digit on the leftmost empty cell, starting with Ana. When the row is filled, the digits are read from left to right to obtain a $2022$-digit number $N$. Borja wins if $N$ is divisible by a number in $S$, otherwise Ana wins. Find which player has a winning strategy and describe it.