MathDB
2016-2017 Fall OMO Problem 20

Source:

November 16, 2016

Problem Statement

For a positive integer kk, define the sequence {an}n0\{a_n\}_{n\ge 0} such that a0=1a_0=1 and for all positive integers nn, ana_n is the smallest positive integer greater than an1a_{n-1} for which ankan1(mod2017)a_n\equiv ka_{n-1}\pmod {2017}. What is the number of positive integers 1k20161\le k\le 2016 for which a2016=1+(20172)?a_{2016}=1+\binom{2017}{2}?
Proposed by James Lin