Let be a positive integer. Dan and Sam play the following coprime game: starting with the set of coprime positive integers of that are less than , the players take turns removing some elements from the set. At a player's turn, he chooses a number that remains, and removes and any integer that is not coprime of that remains. The player who moves last loses.
For example: . Dan chooses , so he removes , , and . The remaining set is . Sam chooses . The remaining set is . Dan is forced to take , so he loses.
Let be the largest positive integer such that if Dan and Sam play the divisor game for and both of them play optimally, the second player wins. Find . If no such exists, enter .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
If m = 1 , then 1 is the only integer removed from the list. If m > 1 , then removing m from the list is equivalent to removing the prime factors of m and their multiples from the list. With this understanding, we can simplify the gameplay. We will start with a list containing 1 and the primes less than and coprime to N . Players will take turns removing one or more integers from this much shorter list observing the following rules:
According to the second rule, when N ≤ 2 0 0 , a player can only remove multiple primes in a single turn if at least one of them is 2, 3, 5, 7, or 11. We will call these five primes the small primes . When there are no small primes left on the list, players remove integers one at a time until there are no integers left.
We will illustrate positions in the game using the symbol s to represent small primes and z to represent other integers. When we write, for example, a player "removes s z ," we mean that the player removes a small prime and another integer that is not a small prime. For convenience, we will list the symbols in two rows. In the following position, there is an odd number of integers and none of them is a small integer. z z z z ⋯ ⋯ z z z ( 1 ) From this position, players will alternately remove one integer at a time until one of them removes the last integer and loses. Clearly, this is a losing position for whichever player plays next. Now consider a position in which there is an even number of integers with exactly two small integers. s z s z z ⋯ ⋯ z z z ( 2 ) If Dan plays next, then Sam has a strategy to force Dan into position (1) by making sure exactly three integers are removed in the following two turns, including both small primes:
In all four cases, Dan is left in position (1) and therefore loses. This strategy works provided two conditions are met: (a) the remaining integers must be small enough so that Sam can remove s s or s z , if necessary; and (b) the remaining integers must be large enough so that Dan cannot remove s s z in a single turn.
We will now demonstrate a strategy with which the second player is guaranteed to win when N = 1 9 9 . First, note that 199 is prime and that there are 45 primes less than 199, including all five small primes. In the simplified gameplay, this means there are 46 integers on the list, the 45 primes plus the integer 1. s s s s s z z z z ⋯ ⋯ z z z Suppose Dan plays first. The strategy for Sam is to make sure that exactly four integers are removed in the first two turns, including exactly three small primes:
This puts Dan in position (2). We must show that Sam can apply this strategy in a way that ensures this is a losing position for Dan based on conditions (a) and (b).
In each of these cases, we can tell by examining the remaining small primes and least remaining non-small prime that conditions (a) and (b) are met. This means Dan (the first player) is in a losing position, so when N = 1 9 9 , Sam (the second player) has a winning strategy.
We are asked to find the largest value of N less than or equal to 200 for which the second player has a winning strategy. We will show that the first player has a winning strategy when N = 2 0 0 . There are 44 primes less than and coprime to 200, so in the simplified gameplay, there are 45 integers on the list, the 44 primes and the integer 1. The three small primes on the list are 3, 7, and 11. s s z s z z ⋯ ⋯ z z z If the first player removes 3 (i.e., removes s ) then the second player will be in position (2) with conditions (a) and (b) met and thus will be in a losing position. Therefore, when N ≤ 2 0 0 , the largest value of N for which the second player has a winning strategy is n = 1 9 9 .