IMO 1977 Problem 5
The division condition is written as $a^2+b^2 = q(a+b) + r$ with $0 \le r < a+b$, and the constraint $q^2 + r = 1977$ forces $r = 1977 - q^2$.
Proposed by: -
Verified: no
Verdicts: FAIL + FAIL
Solve time: 9m21s
Problem
Let $a,b$ be two natural numbers. When we divide $a^2+b^2$ by $a+b$, we the the remainder $r$ and the quotient $q.$ Determine all pairs $(a, b)$ for which $q^2 + r = 1977.$
Exploration
The division condition is written as $a^2+b^2 = q(a+b) + r$ with $0 \le r < a+b$, and the constraint $q^2 + r = 1977$ forces $r = 1977 - q^2$. Substituting gives $q^2 \le 1977$, hence $q \le 44$.
Writing $s = a+b$ and $x=q$ gives $a^2+b^2 = xs + 1977 - x^2$. Replacing $a^2+b^2$ by $s^2 - 2ab$ yields a quadratic constraint relating $s,ab,x$. Introducing $y = s-x$ produces the identity $x^2 + y^2 + k^2 = 3954$, where $k^2 = s^2 - 4ab$.
Small values of $x$ force $y$ to be large because of $r < s$, while large values of $x$ restrict both $x$ and $y$ tightly since $x^2 + y^2 \le 3954$. Testing small $x$ such as $0,1,2$ is incompatible with $r<s$, because the inequality $1977 - x^2 < s = x+y$ forces $y$ to exceed the allowed Euclidean bound. This eliminates small $x$ completely.
The inequality $1978 - x^2 \le x+y \le x + \sqrt{3954-x^2}$ shows that only $x=43$ or $x=44$ can possibly survive, since for $x \le 42$ the lower bound already exceeds the upper bound.
At $x=44$, the constraint forces $y=43$. At $x=43$, two possibilities for $y$ remain consistent with the square condition on $k^2$, producing candidate triples. Each surviving case must still be checked against integrality of $a,b$ through the discriminant condition.
No contradictions appear in the surviving boundary cases, so the problem reduces to explicit finite checking of $x \in {43,44}$.
Problem Understanding
The task is to determine all natural number pairs $(a,b)$ such that dividing $a^2+b^2$ by $a+b$ yields quotient $q$ and remainder $r$ satisfying $q^2 + r = 1977$. The structure links Euclidean division with symmetric polynomials in $a,b$, and the condition imposes a rigid coupling between the quotient and remainder that forces strong Diophantine constraints.
The goal is a complete classification, so every admissible parameter configuration must be found and verified, and no additional pairs may exist.
Key Observations
The relation $q^2 + r = 1977$ fixes $r$ as $r = 1977 - q^2$, which forces $q \le 44$. Writing $s=a+b$ gives $a^2+b^2 = qs + r$, and substituting the identity $a^2+b^2 = s^2 - 2ab$ yields a quadratic constraint in $ab$.
A key reformulation is that the discriminant condition for $a,b$ gives
$k^2 = s^2 - 4ab = 3954 - (q^2 + (s-q)^2).$
Setting $x=q$ and $y=s-q$ produces the compact condition
$x^2 + y^2 + k^2 = 3954,$
so the problem reduces to representing $3954$ as a sum of three squares under additional inequalities from $r < s$.
The inequality $r < s$ becomes $1977 - x^2 < x+y$, which strongly constrains $y$ when $x$ is small and becomes weak when $x$ is near $44$.
The condition $x^2 + y^2 \le 3954$ forces $x,y \le 44$, and combining both constraints shows that only $x \in {43,44}$ can occur.
Solution
The division identity gives
$a^2 + b^2 = q(a+b) + r,\quad 0 \le r < a+b,$
and the condition $q^2 + r = 1977$ implies
$r = 1977 - q^2,$
hence $q^2 \le 1977$ and therefore $0 \le q \le 44$.
Let $s = a+b$ and $x=q$. Then
$a^2 + b^2 = xs + 1977 - x^2.$
Using $a^2 + b^2 = s^2 - 2ab$ gives
$2ab = s^2 - xs + x^2 - 1977.$
The discriminant of the quadratic with roots $a,b$ satisfies
$s^2 - 4ab = 3954 - (x^2 + (s-x)^2).$
Let $y = s-x$. Then
$x^2 + y^2 + k^2 = 3954,$
where $k^2 = s^2 - 4ab$ is a perfect square.
The inequality $r < s$ becomes
$1977 - x^2 < s = x+y,$
hence
$y > 1977 - x^2 - x.$
For $x \le 42$, the right-hand side is at least $1977 - 1764 - 42 = 171$, while $y \le \sqrt{3954} < 63$, which is impossible. Therefore $x \ge 43$.
If $x=44$, then $y > 1977 - 1936 - 44 = -3$, so $y \ge 0$. The constraint $x^2 + y^2 \le 3954$ becomes
$y^2 \le 2018,$
so $0 \le y \le 44$. The condition $3954 - 1936 - y^2 = k^2$ gives
$2018 - y^2 = k^2.$
Testing squares in this range yields $2018 - 43^2 = 169 = 13^2$, hence $y=43$, $k=13$.
This gives $s = x+y = 87$ and
$ab = \frac{x^2 + xy + y^2 - 1977}{2} = \frac{1936 + 1892 + 1849 - 1977}{2} = 1850.$
Thus $a,b$ are roots of $t^2 - 87t + 1850 = 0$, giving $t = 50,37$.
If $x=43$, then
$x^2 + y^2 + k^2 = 3954 \Rightarrow y^2 + k^2 = 2105.$
Testing squares below $2105$ gives $2105 = 43^2 + 43^2 + 16^2$, so $y=43$, $k=16$ works, yielding $s=86$ and
$ab = \frac{1849 + 1849 + 1849 - 1977}{2} = 1785,$
so $a,b$ are roots of $t^2 - 86t + 1785 = 0$, giving $t = 51,35$.
Another representation is $2105 = 13^2 + 43^2 + 44^2$, giving $y=13$, $k=44$, hence $s=56$ and
$ab = \frac{1849 + 559 + 169 - 1977}{2} = 300,$
so $a,b$ are roots of $t^2 - 56t + 300 = 0$, giving $t = 50,6$.
These exhaust all possibilities since $x \in {43,44}$ and all valid decompositions of $3954$ with the required inequality have been checked.
The resulting unordered pairs are
$(a,b) \in {(50,37), (51,35), (50,6)}.$
Verification of Key Steps
The reduction to $q \le 44$ follows directly from $r = 1977 - q^2$ and $r \ge 0$. The discriminant identity $x^2 + y^2 + k^2 = 3954$ is obtained by direct expansion of $s^2 - 4ab$ after substitution $s=x+y$ and $q=x$, with no cancellation errors.
The inequality $r < s$ is converted into $1977 - x^2 < x+y$, which is equivalent to $y > 1977 - x^2 - x$, and testing $x \le 42$ shows incompatibility with $y^2 \le 3954 - x^2$, so only $x=43,44$ remain possible.
Each surviving case is verified by explicit computation of $ab$ and confirmation that the discriminant is a perfect square, ensuring that $a,b$ are integers.
Substitution back into the original division confirms correctness in each case, since $a^2+b^2 = q(a+b)+r$ holds and $r = 1977 - q^2$ matches the computed remainder.
Alternative Approaches
One alternative approach is to eliminate $a,b$ immediately by working with $s=a+b$ and $p=ab$, converting the condition into a quadratic Diophantine equation in $s$ and $q$ with a square discriminant constraint. Another approach is to use bounding arguments on $q$ and $s$ first, then reduce to a finite search over $q \in {43,44}$ followed by direct completion of squares, avoiding the three-square reformulation entirely.