4. Given a sequence of natural numbers $a_{n}$, the terms of which satisfy the relations $a_{n+1}=k \cdot \frac{a_{n}}{a_{n-1}}$ (for $n \geq 2$). All terms of the sequence are integers.

It is known that $a_{1}=1$, and $a_{2018}=2020$. Find the smallest natural $k$ for which this is possible.
Answer: 2020

Solution: Let a2=x. Then all terms of the sequence will have the form $x^{m} k^{n}$.

The powers of $k$ will repeat with a period of 6: $0,0,1,2,2,1,0,0, \ldots$

The powers of $x$ will also repeat with a period of 6: $0,1,1,0,-1,-1,0,1, \ldots$

Since 2018 gives a remainder of 2 when divided by 6, then $a_{2018}=a_{2}=x=2020$. For all terms of the sequence to be integers, it is necessary for $k$ to be a multiple of $x$, the smallest such $k$ is 2020.