Skip to main content
OlympiadHQ

Browse · MathNet

Print

Japan Mathematical Olympiad

Japan counting and probability

Problem

Alice and Bob are playing a game using a blackboard. Initially, each of is written on the blackboard once. Also, a non-empty subset of is given. In the first turn, Alice erases all the elements of from the blackboard. After that, the two players, starting with Bob, take turns erasing one or more integers from the blackboard. However, they cannot erase integers that are relatively prime to all of the integers erased in the opponent's previous turn. The game ends when a player has no integers left to erase at the beginning of their turn, resulting in that player's loss and the other player's win. How many sets are there such that Alice can always win, regardless of Bob's actions?
Solution
For primes , denote by the set of all integers in that do not have any prime factor other than . The blackboard is said to be in -good situation or simply good, if the set of all integers that are already erased is identical to . Lemma. If the blackboard becomes good after a turn, the player who plays the turn is able to win regardless of the opponent's actions. Proof. Suppose that after the turn, the blackboard becomes in -good situation. We only have to consider the case the opponent can erase at least one integer in the next turn. Denote the set of integers erased by the opponent in the next turn by . All elements in have a prime factor other than . Let be prime numbers that are not in but appears as prime factors of some of elements in . Then, is a subset of . Denote by the set of all elements in not included in . Since but , is not empty. Additionally, since any element in has a prime factor in , the player is able to erase all elements in . From the discussion above, it is shown inductively that if the blackboard becomes good after a turn, the player who plays the turn can erase one or more integers and make the blackboard good at every turn afterwards. Especially, the player is able to erase at least one integer at every turn, which imply the player is able to win. ■ Let be prime numbers which divide at least one element of . If , then Alice can always win. If , is not empty. Additionally, since any element in has a prime factor in , by the definition of , Bob can erase all elements in and make the blackboard in -good situation. By the lemma, Bob can win regardless of actions of Alice. Therefore, the sets that satisfy the problem condition are those in the form of with some prime numbers . The number of such sets corresponds to the number of ways to choose one or more elements from the set of prime numbers less than or equal to 50, which is (15 prime numbers). Therefore, the answer is sets.
Final answer
32767

Techniques

Games / greedy algorithmsInvariants / monovariantsPrime numbers