Pigeon - Hole principle and remainder modulus Given any 17 integers.Prove that there is at least one subset of 9 integers whose sum is divisible by 9
Try- I know pigeonhole principle will be used but how to proceed?
 A: First note that any set of five integers includes a subset of three integers whose sum is a multiple of 3.  Proof: Consider the five integers modulo 3. There are three possible congruence classes: 0, 1, and 2.  If three of the integers fall in a single congruence class, then their sum is a multiple of 3, and we are done.  If not, then there is an integer in each of the congruence classes 0, 1, and 2, and their sum is a multiple of three.
Now consider the set of 17 integers.  Remove three integers whose sum is a multiple of three, leaving 14 integers.  Repeat the process on the set of 14, leaving 11; repeat on the set of 11, leaving 8; repeat on the set of 8, leaving 5; and repeat on the set of 5, leaving 2.  Finally we have five sets of three integers each, and the sum of the integers in each set is a multiple of 3.  Consider the sums modulo 9.  Modulo 9, each sum must fall in one of three congruence classes: 0, 3, or 6. If three of the sums fall in the same congruence class, their sum is a multiple of 9.  If not, there must be a sum in each of the congruence classes 0, 3, and 6, and their sum is a multiple of 9.  So in either case, we have nine integers whose sum is a multiple of 9.
A: Let the 17 integers be $A = (a_1,a_2.....,a_{17})$ consider the following sums:
$S_i = \Sigma_{k=1}^{k=i} a_k$
There are 17 such $S_i$. Consider their remainders modulo 9. Then follow the given algorithm:
1)if $S_j (mod 9) = 0$ for some j, remove the $a_1,a_2....a_j$ from set $A$.
2) if 1) does not hold for any j, clearly by pigeonhole, for some j and k, $S_j and S_k$ will have the same remainder modulo 9(only 9 ,pigeonhole and more than 9 sums). Let $j \gt k$. Then the sequence $S_j - S_k$ is congruent to 0( mod 9). Again, remove the $j-k$ elements from $A$.
Note that by performing 1) or 2) for the $nth$ time, we remove some $x_n$ elements  from $A$. Let $Y_n = x_1 + .... +x_n$ . Thus after completion of n step, $17-Y_n$ elements remain in $A$, and we have gathered $Y_n$ elements whose sum is divisible by 9. If $Y_n \ge 9$ for some n, our proof is complete(we have 9 elements). Else, if $Y_n \lt 9$, the no. Of remaining elements is $17- Y_n \gt 8$. So we can continue steps 1 and 2 of the algorithm while $Y_n \lt 9$.Hence proved.
