Problem

Source: KJMO 2020 p6

Tags: KJMO, KMO



for a positive integer $n$, there are positive integers $a_1, a_2, ... a_n$ that satisfy these two. (1) $a_1=1, a_n=2020$ (2) for all integer $i$, $i$satisfies $2\leq i\leq n, a_i-a_{i-1}=-2$ or $3$. find the greatest $n$