Problem

Source: 2020 CMO P5

Tags: number theory, Perfect Square



Given any positive integer $c$, denote $p(c)$ as the largest prime factor of $c$. A sequence $\{a_n\}$ of positive integers satisfies $a_1>1$ and $a_{n+1}=a_n+p(a_n)$ for all $n\ge 1$. Prove that there must exist at least one perfect square in sequence $\{a_n\}$.