Problem 2. $n$ mushroom pickers went to the forest and brought a total of 338 mushrooms (it is possible that some of them did not bring any mushrooms home). Boy Petya, upon learning this, said: "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: 27.

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

$$
0+1+\ldots+(n-2) \leqslant 0+1+\ldots+24=300=338-38
$$

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

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

$$
338=a_{0}+a_{1}+\ldots+a_{25} \geqslant 0+1+\ldots+25=351
$$

a contradiction