IMO 1977 · Problem 5

Let \(a\) and \(b\) be positive integers. When \(a^2+b^2\) is divided by \(a+b\), the quotient is \(q\) and the remainder is \(r\). Find all pairs \((a,b)\) such that \(q^2+r=1977\).

Official text of the problem. Official problem paper (PDF)

Answer

\[ \boxed{(a,b)\in\{(7,50),(37,50),(50,7),(50,37)\}.} \]

Solution

By the division algorithm, \[ a^2+b^2=q(a+b)+r,\qquad 0\le r<a+b. \] Put \(s=a+b\). Since \(a^2+b^2\ge s^2/2\), we have \[ \frac{s^2}{2}\le qs+r<(q+1)s. \] Thus \(s<2q+2\). As all quantities are integers, \[ s\le2q+1,\qquad r\le s-1\le2q. \] Consequently, \[ q^2\le1977=q^2+r\le q^2+2q<(q+1)^2. \] Since \(44^2=1936<1977<2025=45^2\), this forces \[ q=44,\qquad r=41. \]

The division equation therefore becomes \[ a^2+b^2=44(a+b)+41, \] or, after completing the squares, \[ (a-22)^2+(b-22)^2=1009. \] Write \(x=a-22\) and \(y=b-22\). Squares modulo \(8\) are \(0,1,4\), and \(1009\equiv1\pmod8\). Hence one of \(x,y\) is odd and the other is divisible by \(4\).

Let \(t\) be the absolute value of the even coordinate. Since \(t^2\le1009<32^2\), \[ t\in\{0,4,8,12,16,20,24,28\}. \] The other coordinate must have square \(1009-t^2\). The following exhaustive check leaves just one possibility:

\(t\) Check of \(1009-t^2\)
\(0\) \(31^2<1009<32^2\)
\(4\) \(31^2<993<32^2\)
\(8\) \(30^2<945<31^2\)
\(12\) \(29^2<865<30^2\)
\(16\) \(27^2<753<28^2\)
\(20\) \(24^2<609<25^2\)
\(24\) \(20^2<433<21^2\)
\(28\) \(225=15^2\)

Thus \[ \{|x|,|y|\}=\{28,15\}. \] Because \(a,b>0\), we have \(x,y\ge-21\), so the coordinate of absolute value \(28\) must be \(28\). The other coordinate can be \(15\) or \(-15\). Adding \(22\) gives exactly \[ (50,37),\quad(50,7),\quad(37,50),\quad(7,50). \]

For each of these pairs, \(a^2+b^2=44(a+b)+41\), and \(a+b\) is either \(57\) or \(87\). Therefore \(41<a+b\), so the quotient and remainder are indeed \(44\) and \(41\), with \[ 44^2+41=1977. \] All four pairs satisfy the requirements.

The solution was checked against John Scholes' IMO solution archive (Kalva).