Problem

Source: BMO Shortlist 2021

Tags: Balkan, shortlist, number theory, Sequence, recursion, Existence, admiration



Denote by $l(n)$ the largest prime divisor of $n$. Let $a_{n+1} = a_n + l(a_n)$ be a recursively defined sequence of integers with $a_1 = 2$. Determine all natural numbers $m$ such that there exists some $i \in \mathbb{N}$ with $a_i = m^2$. Proposed by Nikola Velov, North Macedonia