Question 110
Let $m \ge 2$ be a positive integer and $p \ge 5$ be a prime number. Consider the sequence $a_n$ defined by $a_n = (p-2)^n + p^n - m$ for $n \ge 1$, and let $q$ be the smallest prime that divides a member of the sequence. Determine all pairs $(m, p)$ such that $q \ge m$.
(Bayarmagnai Gombodorj)
(Bayarmagnai Gombodorj)