MathDB
m boxes with some balls in each box

Source:

August 29, 2010
algorithmrelatively primemodular arithmeticcombinatoricsinvariantIMO Shortlist

Problem Statement

Let mm boxes be given, with some balls in each box. Let n<mn < m be a given integer. The following operation is performed: choose nn of the boxes and put 11 ball in each of them. Prove:
(a) If mm and nn are relatively prime, then it is possible, by performing the operation a finite number of times, to arrive at the situation that all the boxes contain an equal number of balls.
(b) If mm and nn are not relatively prime, there exist initial distributions of balls in the boxes such that an equal distribution is not possible to achieve.