The pigeonhole principle appears constantly in number theory because remainders mod only ever take possible values — an automatic, ready-made set of holes for any sufficiently large collection of integers.
Subset sums divisible by n
A classic application: among any integers, some nonempty subset of consecutiveterms in their running sum has a sum divisible by . The trick is to look at the partial sums (where is the sum of the first terms). If any , you’re done. Otherwise, all partial sums fall into only nonzero residue classes mod — by pigeonhole, two of them share a residue, and the terms between them sum to a multiple of.
Residues among a set of integers
Whenever you have more integers than the modulus you’re working with, two of them are guaranteed to share a residue — and their difference is then guaranteed divisible by that modulus. This single observation is the seed of a large number of number-theory pigeonhole problems.
Worked example
Problem: Prove that among any 6 integers, some nonempty subset has a sum divisible by 6.
Solution: Let the integers be , and form the 6 partial sums . If any , that prefix is our subset. Otherwise, each of the 6 partial sums has a residue in — only 5 possible nonzero values for 6 sums. By pigeonhole, two partial sums (say ) share a residue, so is divisible by 6. That difference is exactly — our subset.
Practice problems
1.Show that among any 3 integers, two of them have a sum that is even.
2.Show that among any 11 integers, two of them have a difference divisible by 10.
3.Given 7 distinct integers, show that some two of them differ by a multiple of 6, or explain why the numbers 1 through 6 (exactly 6 integers) might avoid this.
4.Prove that among any 5 integers, some nonempty subset has a sum divisible by 5.