Problem 2. $n$ mushroom pickers went to the forest and brought a total of 162 mushrooms (each brought at least one mushroom home). Boy Petya, upon learning this, declared: "Some two of them must have brought the same number of mushrooms!" For what smallest $n$ will Petya definitely be right? Don't forget to justify your answer.
Answer: 18.

Solution. First, let's prove that when $n \leqslant 17$, Petya can be wrong. Suppose the first $n-1$ mushroom pickers collected $1, \ldots, n-1$ mushrooms, and the $n$-th collected all the rest. Since

$$
1+\ldots+(n-1) \leqslant 1+\ldots+16=136=162-26
$$

the last mushroom picker collected at least 26 mushrooms, i.e., more than each of the others. Thus, when $n \leqslant 17$, there is an example where Petya could be wrong.

Let's show that when $n=18$, Petya will always be right. Suppose he is wrong and let the mushroom pickers have collected $a_{1}<\ldots<a_{18}$ mushrooms. It is easy to see that $a_{i} \geqslant i$, hence

$$
162=a_{1}+\ldots+a_{18} \geqslant 1+\ldots+18=171
$$

a contradiction