Problem

Source: Brazilian Mathematical Olympiad 2023, Level 2, Problem 5

Tags: fermat's little theorem, Euler s Phi Function, number theory



An integer $n \geq 3$ is fabulous when there exists an integer $a$ with $2 \leq a \leq n - 1$ for which $a^n - a$ is divisible by $n$. Find all the fabulous integers.