CEMC Banner

Problem of the Week
Problem C and Solution
The Great Box Mixup

Problem

Rachel has \(100\) candies that she is placing in small boxes for a party game. She has decided that each box must contain at least one candy and no two boxes can contain the same number of candies. As well, no box can go inside any other box.

Determine the maximum number of boxes Rachel can use for her candies.

Solution

In order to maximize the number of boxes, each box must contain the smallest number of candies possible. However, no two boxes can contain the same number of candies. One way to approach this problem is to put one candy in the first box and then let the number of candies in each box after that be one more than the number of candies in the box before it, until all \(100\) candies are in boxes.

We will put \(1\) candy in the first box, \(2\) candies in the second box, \(3\) candies in the third box, and so on. After filling \(12\) boxes this way, we have used \(1+2+3+4 + 5 + 6 + 7 + 8 + 9 + 10+11+12=78\) candies. After putting \(13\) candies in the thirteenth box, we have used \(78+13=91\) candies. There are \(9\) candies left, but we already have a box containing \(9\) candies. The remaining \(9\) candies must therefore be distributed among the existing boxes while maintaining the condition that no two boxes contain the same number of candies.

There are many ways to do this. One way to do this is to put the \(9\) candies in the last box which already contains \(13\) candies. This would mean that the final box would contain \(13+9=22\) candies. Another solution is to increase the number of candies in each of the final nine boxes by one candy each. The number of candies in each box for this solution is summarized in the following table.

Box Number \(1\) \(2\) \(3\) \(4\) \(5\) \(6\) \(7\) \(8\) \(9\) \(10\) \(11\) \(12\) \(13\)
Number of Candies \(1\) \(2\) \(3\) \(4\) \(6\) \(7\) \(8\) \(9\) \(10\) \(11\) \(12\) \(13\) \(14\)

Either way, the maximum number of boxes required is \(13\).

If you had \(14\) boxes, with the first box containing \(1\) candy and each box after that containing one more candy than the box before, you would need \(1+2+3+4 + 5 + 6 + 7 + 8 + 9 + 10+11+12+13+14=105\) candies, which is more than the number of candies Rachel has available.