  We determine all triples $(a,b,n)$ of positive integers such that $a$ and $b$
are relatively prime and $n^k$ divides $a^n + b^n$ (respectively, $a^n - b^n$),
when $k$ is the maximum of $a$ and $b$ (in fact, we answer a slightly more
general question). As a by-product, it is found that, for $m, n \in \mathbb
N^+$ with $n \ge 2$, $n^m$ divides $ m^n + 1$ if and only if $(m,n)=(2,3)$ or
$(1,2)$, which generalizes problems from the 1990 and 1999 editions of the
International Mathematical Olympiad. The results are related to a conjecture by
K. Gy\H{o}ry and C. Smyth on the finiteness of the sets $R_k^\pm(a,b) := \{n
\in \mathbb N^+: n^k \mid a^n \pm b^n\}$, when $a,b,k$ are fixed integers with
$k \ge 3$, $\gcd(a,b) = 1$ and $|ab| \ge 2$.
