Problem

Source: Latvian TST for Baltic Way 2020 P16

Tags: number theory, least common multiple, greatest common divisor



Given sequence $\{a_n\}$ satisfying: $$ a_{n+1} = \frac{ lcm(a_n,a_{n-1})}{\gcd(a_n, a_{n-1})} $$It is given that $a_{209} =209$ and $a_{361} = 361$. Find all possible values of $a_{2020}$.