A total of objects are put into nonempty bags where is a positive integer. These bags can be distributed into red boxes and also into blue boxes so that each red and each blue box contain and objects, respectively. Find the minimum value of .
Solution
We shall prove this general with red boxes and blue boxes and objects, with coprime. Suppose the bags have been distributed as described, with each red box containing objects and each blue box containing objects. Suppose we have a collection of red and blue boxes. We say that a bag is internal (with respect to the collection) if it is contained in a red box and a blue box in the collection. It is external if it is contained in only one of the boxes in the collection. If the collection does not have any external bags, then . Since are coprime, we have . This means any collection of boxes, with , must have an external bag.
We shall prove that for every , there is a collection of red and blue boxes with that has at least internal bags and at least 1 external bag. This is certainly true for since every bag is contained in a red box and a blue box and that these 2 boxes have an external bag. Inductively, suppose and there is a collection of boxes with internal bags and 1 external bag. By putting the box that contains the external bag into the collection, we have a collection of boxes with internal bags. Since , the collection also has an external bag. This can continue until . For this collection, we have internal and 1 external bag giving a total bags. Thus .
Next we shall show that is sufficient. Apply the division algorithm, assuming that , we have where . Suppose that we have solved the problem for , i.e., we have bags containing a total of objects and these bags can be distributed into red boxes, with objects in each box and into blue boxes, , with objects in each box. Now add another bags with objects in each bag. We have a total bags with a total of objects. Put each of these new bags into a new blue box, then, together with , we have blue boxes each with objects. Next into each of the red boxes , put of these new bags so that each box has objects. Thus we have a solution for . Since are coprime, applying the division algorithm repeatedly, we eventually get to the situation where . For the solution to the problem with objects, we simply put 1 object in each bag.
For , we have , , . Thus our solution is 8 bags with 1 object, 8 bags with 8 objects, 9 bags with 9 objects, 34 bags with 17 objects.