6. (8 points) On the board, 31 ones are written. Every minute, Karlson erases two arbitrary numbers and writes their sum on the board, and then eats a number of candies equal to the product of the two erased numbers. What is the maximum number of candies he could eat in 31 minutes?
Answer: 465.

Solution: Let's represent 31 units as points on a plane. Each time we combine numbers, we will connect the points of one group with all the points of the second group with line segments. Note that if we replace numbers $x$ and $y$ with $x+y$, the groups " $x$ " and " $y$ " will be connected by $xy$ line segments. This is the same number of candies that Karlson eats. After 31 minutes, all points will be connected. In total, $\frac{31 \cdot(31-1)}{2}=465$ line segments will be drawn. Therefore, Karlson will eat 465 candies.