Problem

Source: Thailand MO 2024 Day 1 P2

Tags: number theory



Find all pairs of positive integers $(m,n)$ such that $\frac{m^5+n}{m^2+n^2}$ and $\frac{m+n^5}{m^2+n^2}$ are integers.