MathDB
Looking for the smallest ghost

Source: 2021 Mexico Center Zone Regional Olympiad, problem 1

January 17, 2022
Mexiconumber theoryarithmetic sequenceinduction

Problem Statement

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