先手还是后手:选到有公因子就输
Prime First
题目详情
集合 。Alice 与 Bob 轮流从 中选一个未选过的整数。
规则:若某人选到的整数与先前已被选过的任意整数有公因子(>1),则该人立刻输。
Alice 可以选择先手或后手。令 表示应先手, 表示应后手。
已知 Alice 在她第一步有 6 个最优首选 。求
Consider the set of integers . Alice and Bob play a game where they take turns selecting integers from . The first player to select an integer that shares a common factor with a previously picked integer loses. Alice has the ability to determine if she wants to select first or second. Assume both players play optimally. Let if Alice should choose to go first and if she should go second. There are optimal selections for Alice's first turn. Find .
解析
Alice 应该先手()。她可以先选 6(或 12/18/24),一次性“消掉”质因子 2 与 3,从而把局面引导到对自己有利的必胜结构;另外 5 与 25 也能作为必胜开局。
6 个最优首选可取 ,因此
Original Explanation
Consider all the primes in . There are such integers. The key idea to notice here is that for whoever selects the integer , that eliminates and . Therefore, no other pairwise products of primes among the remaining prime integers are at most . Therefore, there would be primes left, and whoever is selecting first in this new game loses, as they can only eliminate one prime factor a turn. However, this "new game" is really just the second turn our game after we eliminate and . Therefore, Alice should go first, select the value (alternatively, or also work, as they have the same primes in the factorization) so that she can eliminate both and , and then Bob and Alice alternate selecting among the remaining prime integers. Then, Bob would be forced to pick some non-prime integer, which will have a prime factor among those already eliminated, so Bob will lose. Therefore, Alice should go first, and the answer is .
However, there is also another sneaky starting integer, which is . This is because regardless of what Bob selects on his first turn after Alice selects , Alice can force Bob to eliminate one prime factor at a time after her next turn, so this also works. Since works, also works. Therefore,