MathLabs

Problem 5

Let a,ba,b be positive integers. Dividing a2+b2a^2+b^2 by a+ba+b gives quotient qq and remainder rr. Find all pairs (a,b)(a,b) such that q2+r=1977q^2+r=1977.
Step 2 of 4: Force the quotient
q≤43⟹r=1977−q2≥128>s(s≤2q+1≤87)q\le43\Longrightarrow r=1977-q^2\ge128>s\quad(s\le2q+1\le87)
Detailed analysis

If q≤43q\le43, then r=1977−q2≥1977−432=128r=1977-q^2\ge1977-43^2=128, while s≤2q+1≤87s\le2q+1\le87 and r<sr<s. This is impossible. Together with q≤44q\le44, it forces q=44q=44 and r=41r=41.