A group of \(n \geqslant 3 \) children are standing in a circle. They all start with a multiple of 3 candies each (not necessarily equal), and perform the following algorithm:

Step 1.Each child divides their candies equally into 3 piles. Proceed to step 2.

Step 2.Each child gives 1 pile to the person on their left and 1 pile to the person on their right. Keep the last pile. Proceed to step 3.

Step 3.Each child now counts the number of candies they have.

- If it's not a multiple of 3, grab candies from the candy bag one by one until it becomes a multiple of 3 and proceed to step 4.
- If it's already a multiple of 3, do nothing and proceed to step 4.

Step 4.At this point, if everyone has the same number of candies, stop, or else, repeat from step 1.

Assuming they have an infinite supply of candies from the candy bag, will this algorithm ever end?

×

Problem Loading...

Note Loading...

Set Loading...