Skip to main content
OlympiadHQ

Browse · MathNet

Print

Junior Balkan Mathematical Olympiad

North Macedonia number theory

Problem

Find all distinct prime numbers , and such that
Solution
First notice that if both primes and differ from , then , hence the left hand side of the given equation is congruent to zero modulo , which is impossible since is not divisible by . Thus, or . We consider two cases.

Case 1. . The equation reduces to . If , by Fermat's little theorem, , which yields , or equivalently, . The last congruence is impossible in view of the fact that a residue of a square of a positive integer belongs to the set . Therefore and .

Case 2. . The equation becomes . Obviously . Hence, Fermat's little theorem gives . But then , which is impossible.

Hence, the only solution of the given equation is , , .
Final answer
p=5, q=3, r=19

Techniques

Techniques: modulo, size analysis, order analysis, inequalitiesFermat / Euler / Wilson theoremsQuadratic residues