Maths Olympiad Prep

Library / /18 of 19

Combinatorics Difficulty 7.0 National olympiad, round 2 Prove it North Macedonia

For a positive integer nn, two players AA and BB play the following game: Given a pile of ss stones, the players take turns alternatively with AA going first. On each turn the player is allowed to take either one stone, or a prime number of stones, or a multiple of nn stones. The winner is the one who takes the last stone. Assuming both AA and BB play perfectly, for how many values of ss can player AA not win?

Solution

Denote by kk the sought number and let {s1,s2,,sk}\{s_1, s_2, \dots, s_k\} be the corresponding values for ss. We call each sis_i a losing number and every other nonnegative integer a winning number.

(I) **Clearly every multiple of nn is a winning number.**
Suppose there are two different losing numbers si>sjs_i > s_j, which are congruent modulo nn. Then, on his first turn of play, player AA may remove sisjs_i - s_j stones (since nsisjn \mid s_i - s_j), leaving a pile with sjs_j stones for BB. This is in contradiction with both sis_i and sjs_j being losing numbers.

(II) **Hence, there are at most n1n-1 losing numbers, i.e. kn1k \le n-1.**
Suppose there exists an integer r{1,2,,n1}r \in \{1, 2, \dots, n-1\}, such that mn+rmn + r is a winning number for every mN0m \in \mathbb{N}_0. Let us denote by uu the greatest losing number (if k>0k > 0) or 00 (if k=0k = 0), and let s=LCM(2,3,,u+n+1)s = \text{LCM}(2, 3, \dots, u + n + 1). Note that all the numbers s+2,s+3,,s+u+n+1s + 2, s + 3, \dots, s + u + n + 1 are composite. Let mN0m' \in \mathbb{N}_0, be such that s+u+2mn+rs+u+n+1s + u + 2 \le m'n + r \le s + u + n + 1. In order for mn+rm'n + r to be a winning number, there must exist an integer pp, which is either one, or prime, or a positive multiple of nn, such that mn+rpm'n + r - p is a losing number or 00, and hence lesser than or equal to uu. Since s+2mn+rupmn+rs+u+n+1s + 2 \le m'n + r - u \le p \le m'n + r \le s + u + n + 1, pp must be a composite, hence pp is a multiple of nn (say p=qnp = qn). But then mn+rp=(mq)n+rm'n + r - p = (m' - q)n + r must be a winning number, according to our assumption. This contradicts our assumption that all numbers mn+rmn + r, mN0m \in \mathbb{N}_0 are winning.

(III) **Hence, each nonzero residue class modulo nn contains a losing number.

(IV) There are exactly n1n-1 losing numbers (one for each residue r{1,2,,n1}r \in \{1, 2, \dots, n-1\}).

Similar proof of (III):

Lemma:** No pair (u,n)(u, n) of positive integers satisfies the following property:
(*) In N\mathbb{N} exists an arithmetic progression (ai)i=1(a_i)_{i=1}^{\infty} with difference nn such that each segment [aiu,ai+u][a_i - u, a_i + u] contains a prime.

Proof of the lemma: Suppose such a pair (u,n)(u, n) and a corresponding arithmetic progression (ai)i=1(a_i)_{i=1}^{\infty} exist. In N\mathbb{N} exist arbitrarily long patches of consecutive composites. Take such a patch PP of length 3un3un. Then, at least one segment [aiu,ai+u][a_i - u, a_i + u] is fully contained in PP, a contradiction.

Suppose such a nonzero residue class modulo nn exists (hence n>1n > 1). Let uNu \in \mathbb{N} be greater than every losing number. Consider the members of the supposed residue class which are greater than uu. They form an arithmetic progression with the property (*), a contradiction (by the lemma).

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.