Problem

Source: Mexico National Olympiad Mock Exam 2021 P6

Tags: number theory



Let $a$ and $b$ be fixed positive integers. We say that a prime $p$ is fun if there exists a positive integer $n$ satisfying the following conditions: $p$ divides $a^{n!} + b$. $p$ divides $a^{(n + 1)!} + b$. $p < 2n^2 + 1$. Show that there are finitely many fun primes.