Daily

Random

Practice set

Baltic Way 1991 · Problem 1

Number Theory

Find the smallest positive integer nn having the property: for any set of nn distinct integers a1,a2,…,ana_{1}, a_{2}, \ldots, a_{n} the product of all differences ai−aj,i<ja_{i}-a_{j}, i<j is divisible by 1991 .

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Primes · Divisibility and factorization

Solutions

Solution

Solution:

Let S=∏1≤i<j≤n(ai−aj)S = \prod_{1 \leq i < j \leq n} (a_{i} - a_{j}). Note that 1991=11⋅1811991 = 11 \cdot 181. Therefore SS is divisible by 19911991 if and only if it is divisible by both 1111 and 181181.

If n≤181n \leq 181 then we can take the numbers a1,…,ana_{1}, \ldots, a_{n} from distinct congruence classes modulo 181181 so that SS will not be divisible by 181181.

On the other hand, if n≥182n \geq 182 then according to the pigeonhole principle there always exist aia_{i} and aja_{j} such that ai−aja_{i} - a_{j} is divisible by 181181 (and of course there exist aka_{k} and ala_{l} such that ak−ala_{k} - a_{l} is divisible by 1111).