Problem

Source: 2021 Pan-African Mathematics Olympiad, Problem 4

Tags: PAMO, number theory, Divisibility



Find all integers $m$ and $n$ such that $\frac{m^2+n}{n^2-m}$ and $\frac{n^2+m}{m^2-n}$ are both integers.