Problem

Source:

Tags: counting, IMO, IMO 2005, number theory, combinatorics, IMO Shortlist, Hi



Let $a_1,a_2,\ldots$ be a sequence of integers with infinitely many positive and negative terms. Suppose that for every positive integer $n$ the numbers $a_1,a_2,\ldots,a_n$ leave $n$ different remainders upon division by $n$. Prove that every integer occurs exactly once in the sequence $a_1,a_2,\ldots$.