Let \( a_1 \) be an integer greater than or equal to 2. Consider the sequence such that its first term is \( a_1 \), and for \( a_n \), the \( n \)-th term of the sequence, we have \[ a_{n+1} = \frac{a_n}{p_k^{e_k - 1}} + 1, \]where \( p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k} \) is the prime factorization of \( a_n \), with \( 1 < p_1 < p_2 < \cdots < p_k \), and \( e_1, e_2, \dots, e_k \) positive integers. For example, if \( a_1 = 2024 = 2^3 \cdot 11 \cdot 23 \), the next two terms of the sequence are \[ a_2 = \frac{a_1}{2^{3-1}} + 1 = \frac{2024}{4} + 1 = 2025 = 3^4 \cdot 5^2; \]\[ a_3 = \frac{a_2}{5^{2-1}} + 1 = \frac{2025}{5} + 1 = 406. \] Determine for which values of \( a_1 \) the sequence is eventually periodic and what all the possible periods are. Note: Let \( p \) be a positive integer. A sequence \( x_1, x_2, \dots \) is eventually periodic with period \( p \) if \( p \) is the smallest positive integer such that there exists an \( N \geq 0 \) satisfying \( x_{n+p} = x_n \) for all \( n > N \).
Problem
Source: Brazilian Mathematical Olympiad 2024, Level 3, Problem 1
Tags: Sequence, Periodic sequence, prime factorization, number theory