Problem

Source: IMO Shortlist 2023 N5

Tags: IMO Shortlist, number theory, AZE IMO TST



Let $a_1<a_2<a_3<\dots$ be positive integers such that $a_{k+1}$ divides $2(a_1+a_2+\dots+a_k)$ for every $k\geqslant 1$. Suppose that for infinitely many primes $p$, there exists $k$ such that $p$ divides $a_k$. Prove that for every positive integer $n$, there exists $k$ such that $n$ divides $a_k$.