Problem:
Let be a subset of such that no two elements of have a sum divisible by . Find the maximum number of elements that can have.
Solution
Solution:
Let us consider the set modulo . Since , the residues modulo that appear are repeated times each, and appearing one more time each.
Let us group the numbers by their residues modulo .
For each pair of residues and (with ), the sum is divisible by . Thus, we cannot have both and in .
The residue (i.e., multiples of ) is its own pair, so at most one element with residue can be in .
If is even, then , but since is odd, there is no such residue.
So, for each pair with , we can take all numbers with residue or all with residue , but not both.
Let us count how many numbers there are for each residue:
- For , there are numbers with residue (since full cycles plus one extra for ).
- For , there are numbers with residue .
Let us maximize the total size of .
For each pair with :
- has numbers if .
- has numbers if (i.e., ).
So, for each pair, we should pick the residue with more numbers, i.e., (), which has numbers.
There are such pairs, so numbers.
Now, consider residue (i.e., ):
- The numbers with residue are .
- , so multiples of up to .
- , so only such numbers.
- So, at most one can be chosen.
Residue is left unpaired (since is already paired with ). Residue has numbers.
Thus, the maximum is:
Therefore, the answer is .