Problem:
For an integer , denote by the largest nonnegative integer such that . For a given , determine the largest possible cardinality of a subset of the set with the following property:
Problem:
For an integer , denote by the largest nonnegative integer such that . For a given , determine the largest possible cardinality of a subset of the set with the following property:
Solution:
We shall prove by induction on that the set contains at most distinct elements modulo . This trivially holds for . Let . By the induction hypothesis, the elements of the set give at most residues modulo . Suppose that the elements of give more than residues modulo . By the Pigeonhole Principle, at least three of these residues are equal modulo . But among these three residues, two differ by , contrary to the condition of the problem.
It follows that . An example of a set with elements is obtained by including numbers of the form for all subsets of the set .
Second solution. We say that a set is happy if is even for all , and unhappy if is odd for all . Denote by and , respectively, the maximal cardinalities of a happy and an unhappy subset of the set .
Consider a happy set . Since , the sets and are unhappy subsets of the set and have at most elements each. On the other hand, if is an unhappy set, the set is happy and has elements. It follows that .
Similarly, if is an odd set, all of its elements have the same parity, and the set is happy. On the other hand, if is happy, the set is unhappy. From this, .
The relations obtained give for , so from and , by simple induction we obtain .