Browse · MathNet
PrintChina Mathematical Olympiad
China counting and probability
Problem
Given positive integers and . Find the smallest integer () with the following property: if an -element set of integers contains a complete residue system modulo , then it has a nonempty subset such that the sum of its elements is divisible by .
Solution
First we show that . Let , and write , . If , there exists a complete residue system modulo , , such that their residues modulo consist exactly of groups of . For example, the following numbers have the required property: Finding another numbers that are congruent to modulo , the set contains a complete residue system modulo , however none of its nonempty subsets has its sum of elements divisible by . In fact, the sum of the (smallest nonnegative) residue modulo of all elements of is greater than zero and less than or equal to . Thus i.e.
Next we show that has the required property. The following key fact is frequently used in the proof: among any integers, one can find a (nonempty) subset whose sum is divisible by . Let be integers, . If some is divisible by , then the result is true. Otherwise there exist , such that , then is divisible by , the result is again true. The following fact is an easy corollary of the previous result: among any integers, each of which is a multiple of , one can find a (nonempty) subset whose sum is divisible by .
Returning to the problem, we shall discuss two cases.
Case 1: , and . We call a finite set of integers a -set if the sum of all its elements is divisible by . Let be a complete residue system modulo . Clearly we can divide these numbers into groups, each group consisting of a complete residue system modulo . Let be a complete residue system modulo , and . If is odd, we can divide each group into -sets, for example: . We get -sets. Since , we can choose some of these -sets such that the sum of their elements is divisible by . If is even, similarly, a complete residue system modulo can be divided into -sets, with remaining. Two remaining numbers can form another -set. In the end we divide into -sets (possibly with a number left if is odd). Since , we have , again we can find some of these -sets such that the sum of all their elements is divisible by .
Case 2: , . Let be an -element set, containing a complete residue system modulo , , with some other numbers. If is odd, as shown in case 1, we may divide into -sets. Divide the remaining numbers arbitrarily into groups, each with numbers. Among each group of numbers one may find a -set, therefore we have another -sets, and totally -sets. If is even, as discussed in case 1, we may divide into -sets. If is odd, we are left with a number with . Dividing the other numbers arbitrarily into groups, each with numbers. From each group we can find a -set; from any two -sets, we can find a -set. If even, then we can find another -sets, and totally -sets. If is odd, is a -set, we have -sets, and also -sets. Again we can find -sets. Finally we can choose some of these -sets, such that the sum of all their elements is divisible by .
Final answer
N = \max\{\, m,\; m + n - \tfrac{1}{2} m\big(\gcd(m,n) + 1\big) \,\}.
Techniques
Pigeonhole principleGreatest common divisors (gcd)