Find the greatest positive integer $n$ such that there exist positive integers $a_1, a_2, ..., a_n$ for which the following holds $a_{k+2} = \dfrac{(a_{k+1}+a_k)(a_{k+1}+1)}{a_k}$ for all $1 \le k \le n-2$. Proposed by Mykhailo Shtandenko and Oleksii Masalitin