MathDB
Find all a_1 that make the sequence eventually periodic, and all periods

Source: Brazilian Mathematical Olympiad 2024, Level 3, Problem 1

October 12, 2024
SequencePeriodic sequenceprime factorizationnumber theory

Problem Statement

Let a1 a_1 be an integer greater than or equal to 2. Consider the sequence such that its first term is a1 a_1 , and for an a_n , the n n -th term of the sequence, we have an+1=anpkek1+1, a_{n+1} = \frac{a_n}{p_k^{e_k - 1}} + 1, where p1e1p2e2pkek p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k} is the prime factorization of an a_n , with 1<p1<p2<<pk 1 < p_1 < p_2 < \cdots < p_k , and e1,e2,,ek e_1, e_2, \dots, e_k positive integers.
For example, if a1=2024=231123 a_1 = 2024 = 2^3 \cdot 11 \cdot 23 , the next two terms of the sequence are a2=a1231+1=20244+1=2025=3452; a_2 = \frac{a_1}{2^{3-1}} + 1 = \frac{2024}{4} + 1 = 2025 = 3^4 \cdot 5^2; a3=a2521+1=20255+1=406. a_3 = \frac{a_2}{5^{2-1}} + 1 = \frac{2025}{5} + 1 = 406.
Determine for which values of a1 a_1 the sequence is eventually periodic and what all the possible periods are.
Note: Let p p be a positive integer. A sequence x1,x2, x_1, x_2, \dots is eventually periodic with period p p if p p is the smallest positive integer such that there exists an N0 N \geq 0 satisfying xn+p=xn x_{n+p} = x_n for all n>N n > N .