7.4. We have a set consisting of $n$ weights weighing $1,2, \ldots, n$ (grams). Can all the weights be divided into two piles of equal weight if: a) $n=30$, b) $n=31$.
Answer. a) No; b) Yes. Solution. a) The total weight of all weights is odd, since the number of weights with an odd weight is an odd number (these are 15 weights with weights $1,3,5, \ldots, 29$). Therefore, it is impossible to divide the weights into two piles of equal weight.

b) First, place the weight 31 in the left pile, and the two weights 1 and 30 in the right pile. We have the equality: $31=30+1$. There are 28 weights left. Next, place two weights 2 and 29 in the left pile, and 3 and 28 in the right pile, their sums are also equal. And so on: we will place two weights in the left and right piles, equally distant from the ends (i.e., from 2 and 29):

$$
4+27=5+26, \ldots, 14+17=15+16
$$

As a result, the weight of the left pile will be equal to $31+31 \cdot 7=248$ (g), and the right pile will have the same weight.