Problem

Source: Middle European Mathematical Olympiad 2012 - Individuals I-4

Tags: number theory, prime numbers, number theory proposed



The sequence $ \{ a_n \} _ { n \ge 0 } $ is defined by $ a_0 = 2 , a_1 = 4 $ and \[ a_{n+1} = \frac{a_n a_{n-1}}{2} + a_n + a_{n-1} \] for all positive integers $ n $. Determine all prime numbers $ p $ for which there exists a positive integer $ m $ such that $ p $ divides the number $ a_m - 1 $.