Problem

Source: Korean National Olympiad P5

Tags: combinatorics, Integer sequence



For some positive integer $n$, there exists $n$ different positive integers $a_1, a_2, ..., a_n$ such that $(1)$ $a_1=1, a_n=2000$ $(2)$ $\forall i\in \mathbb{Z}$ $s.t.$ $2\le i\le n, a_i -a_{i-1}\in \{-3,5\}$ Determine the maximum value of n.