Problem

Source: 2024 Brazil Ibero TST P1

Tags: number theory, phi function, coprime



Given an integer $n > 1$, let $1 = a_1 < a_2 < \cdots < a_t = n - 1$ be all positive integers less than $n$ that are coprime to $n$. Find all $n$ such that there is no $i \in \{1, 2, \ldots , t - 1\}$ satisfying $3 | a_i + a_{i+1}$.