Problem

Source: 2023 Israel Olympic Revenge P4

Tags: olympic revenge, number theory



Let $c$ be a positive real and $a_1, a_2, \dots$ be a sequence of nonnegative integers satisfying the following conditions for every positive integer $n$: (i)$\frac{2^{a_1}+2^{a_2}+\cdots+2^{a_n}}{n}$ is an integer; (ii)$\textbullet 2^{a_n}\leq cn$. Prove that the sequence $a_1, a_2, \dots$ is eventually constant.