Find all $\{a_n\}_{n\ge 0}$ that satisfies the following conditions. (1) $a_n\in \mathbb{Z}$ (2) $a_0=0, a_1=1$ (3) For infinitly many $m$, $a_m=m$ (4) For every $n\ge2$, $\{2a_i-a_{i-1} | i=1, 2, 3, \cdots , n\}\equiv \{0, 1, 2, \cdots , n-1\}$ $\mod n$
Problem
Source: 2016 Korea Winter Program Test1 Day2 #5
Tags: algebra, algebra proposed, Integer sequence, number theory