Problem

Source: 2019 Saudi Arabia IMO TST II p1

Tags: number theory, divides, divisible



Let $a_0$ be an arbitrary positive integer. Let $(a_n)$ be infinite sequence of positive integers such that for every positive integer $n$, the term $a_n$ is the smallest positive integer such that $a_0 + a_1 +... + a_n$ is divisible by $n$. Prove that there exist $N$ such that $a_{n+1} = a_n$ for all $n \ge N$