Problem

Source: 2021 Mexico Center Zone Regional Olympiad, problem 1

Tags: Mexico, number theory, arithmetic sequence, induction



Let $p$ be an odd prime number. Let $S=a_1,a_2,\dots$ be the sequence defined as follows: $a_1=1,a_2=2,\dots,a_{p-1}=p-1$, and for $n\ge p$, $a_n$ is the smallest integer greater than $a_{n-1}$ such that in $a_1,a_2,\dots,a_n$ there are no arithmetic progressions of length $p$. We say that a positive integer is a ghost if it doesn’t appear in $S$. What is the smallest ghost that is not a multiple of $p$? Proposed by Guerrero