Skip to main content
OlympiadHQ

Browse · MathNet

Print

SAUDI ARABIAN MATHEMATICAL COMPETITIONS

Saudi Arabia counting and probability

Problem

On the table, there are marbles and two students alternatively take a positive number of marble(s). The student goes first, goes after that and so on. On the first move, takes marbles with . On the moves after that, and are not allowed to take more than marbles or marble. The student who takes the last marble(s) on the table will be the winner. Find all values of the student should choose to make sure that there is a strategy for him to win the game.
Solution
After the first move, there are marbles remaining and both students cannot take more than marbles during their turn.

We shall prove that if then the student will have the strategy to win the game.

Indeed, let with . On each turn, if chooses marble(s) then will choose marble(s) on his next turn. Since then which implies that always can perform his turn. After turns of and turns of , student takes the last marble then wins the game.

If is not divisible by then we put with . In this case, the student can take marbles on the next turn. The number of remaining marbles is then by applying the same argument above, the student has the strategy to win the game.

Hence, the condition we have to find is or . Note that the divisors of are then This means that all values of we need to find are .

Final answer
4, 24, 40, 204

Techniques

Games / greedy algorithmsInvariants / monovariants