Example 15. Let $a, b \in N$, when $a^{2}+b^{2}$ is divided by $a+b$, the quotient is $q$, and the remainder is $r$. Find all pairs of numbers $(a, b)$ such that $q^{2}+r=1977$. (19th 1MO problem)
Given $a^{2}+b^{2}=q(a+b)+r$,
$$
q^{2}+r=1977 \quad(0 \leqslant r < q^2),
$$
if $q \geq 45$, then $q^2 \geq 2025 > 1977$, a contradiction. If $q \leq 43$, then $r > 128$, also a contradiction. Hence $q=44$, $r=41$, and $a^{2}+b^{2}=44(a+b)+41$.
This simplifies to $(a-22)^{2}+(b-22)^{2}=1009$. The solutions are
$(a, b)=(50,37),(50,7),(37,50),(7,50)$.