Problem

Source: Macedonian Mathematical Olympiad 2023 P2

Tags: number theory



Let $p$ and $q$ be odd prime numbers and $a$ a positive integer so that $p|a^q+1$ and $q|a^p+1$. Show that $p|a+1$ or $q|a+1$. Proposed by Nikola Velov