Maths WorkshopMaths problems with full solutions
Exercise 1647Number theory › Divisibility and gcdOlympiadAdded 3 Nov 2026

Coprime sums and products

#coprime#sum#product

Statement

Let a,b∈N∗a,b\in\mathbb{N}^* with gcd⁡(a,b)=1\gcd(a,b)=1. Show that gcd⁡(a+b,a2−ab+b2)=1\gcd(a+b,a^2-ab+b^2)=1 or 33.

Hint

Note that a2−ab+b2=(a+b)2−3aba^2-ab+b^2=(a+b)^2-3ab. Any common divisor of a+ba+b and a2−ab+b2a^2-ab+b^2 divides 3ab3ab and a+ba+b.

Show solutionHide solution

Solution

Setup. Let d=gcd⁡(a+b,a2−ab+b2)d=\gcd(a+b,a^2-ab+b^2).

dd divides 3ab3ab. a2−ab+b2=(a+b)2−3aba^2-ab+b^2=(a+b)^2-3ab, and d∣(a+b)2d\mid(a+b)^2, so d∣3abd\mid3ab.

dd coprime to abab. If a prime p∣dp\mid d and p∣abp\mid ab: WLOG p∣ap\mid a. Then p∣a+bp\mid a+b gives p∣bp\mid b, contradicting gcd⁡(a,b)=1\gcd(a,b)=1. So gcd⁡(d,ab)=1\gcd(d,ab)=1.

Conclusion. gcd⁡(d,3ab)=1\gcd(d,3ab)=1 and d∣3abd\mid 3ab together give d∣3d\mid3. So d∈{1,3}d\in\{1,3\}.