# Variations of the Game 3-Euclid

Authors: Nhan Bao Ho
Journal: International Journal of Combinatorics
 (2012)

---

## Abstract

We present two variations of the game 3-Euclid. The games involve a triplet of positive integers. Two players move alternately. In the first game, each move is to subtract a positive integer multiple of the smallest integer from one of the other integers as long as the result remains positive. In the second game, each move is to subtract a positive integer multiple of the smallest integer from the largest integer as long as the result remains positive. The player who makes the last move wins. We show that the two games have the same𝒫-positions and positions of Sprague-Grundy value 1. We present three theorems on the periodicity of 𝒫-positions and positions of Sprague-Grundy value 1. We also obtain a theorem on the partition of Sprague-Grundy values for each game. In addition, we examine the misère versions of the two games and show that the Sprague-Grundy functions of each game and its misère version differ slightly.


---

## Body

## 1. Introduction

The game Euclid, introduced by Cole and Davie [1], is a two-player game based on the Euclidean algorithm. A position in Euclid is a pair of positive integers. The two players move alternately. Each move is to subtract from one of the entries a positive integer multiple of the other without making the result negative. The game stops when one of the entries is reduced to zero. The player who makes the last move wins. In the literature, the term Euclid has been also used for a variation presented by Grossman [2] in which the game stops when the two entries are equal. More details and discussions on Euclid and Grossman’s game can be found in [3–9]. Some restrictions of Grossman’s game can be found in [10–12]. The misère version of Grossman’s game was studied in [13].Collins and Lengyel [11] presented an extension of Grossman’s game to three dimensions that they called 3-Euclid. In 3-Euclid, a position is a triplet of positive integers. Each move is to subtract from one of the integers a positive integer multiple of one of the others as long as the result remains positive. Generally, from a position (a,b,c), where a≤b≤c, there are three types of moves in 3-Euclid: (i) 1-2 moves: subtracting a multiple of a from b; (ii) 1–3 moves: subtracting a multiple of a from c; (iii) 2-3 moves: subtracting a multiple of b from c.In this paper, we present two restrictions of Collins and Lengyel’s game. In the first restriction that we callG1, a move is to subtract a positive integer multiple of the smallest integer from one of the other integers as long as the result remains positive. In the second restriction that we call G2, each move is to subtract a positive integer multiple of the smallest integer from the largest integer as long as the result remains positive. The two games therefore stop when the three integers are equal. Thus, the game G1 is a restriction of the game 3-Euclid allowing the 1-2 and 1–3 moves while the game G2 is a restriction of 3-Euclid allowing only the 1–3 move. We investigate 𝒫-positions and positions of Sprague-Grundy value 1 of the two games G1 and G2.Recall that a positionp is said to be an 𝒩-position (we write p∈𝒩) if the next player to move from p has a strategy to win. Otherwise, p is said to be a 𝒫-position (we write p∈𝒫). Note that every move from a 𝒫-position terminates at some 𝒩-position while from an 𝒩-position, there exists a move terminating at some 𝒫-position.Throughout this paper, the Sprague-Grundy value of the positionp is denoted by 𝒢(p). Not surprisingly, the Sprague-Grundy functions for 3-Euclid, G1, and G2 are pairwise distinct. For example, calculations show that for the position (2,3,7) the Sprague-Grundy value is 1 for 3-Euclid, 2 for G1, and 3 for G2. The 𝒫-positions of 3-Euclid also differ to those of G1 and G2. For example, (3,6,7) is a 𝒫-position in 3-Euclid, but it has Sprague-Grundy value 1 for G1 and G2. Curiously, G1 and G2 have the same 𝒫-positions and the same positions of Sprague-Grundy value 1. This is the main result in this paper.This paper is organized as follows. In Section2, we show that the two games G1 and G2 have the same 𝒫-positions before proving a periodicity result for the 𝒫-positions. We also give some classes of 𝒫-positions of the two games. In Section 3, we show that the two games G1 and G2 also have the same positions of Sprague-Grundy value 1 and then present some connections between positions of Sprague-Grundy value 1 and 𝒫-positions. We give two theorems on the periodicity of the positions of Sprague-Grundy value 1. Some special cases of positions of Sprague-Grundy value 1 are also discussed. Section 4 discusses the existence of values c satisfying the condition 𝒢(a,b,c)=s for some given a,b,s. This is analogous to a result of Collins and Lengyel [11]. Section 5 examines the misère versions of the two games G1 and G2. It will be shown that these two games and their misère versions differ slightly only on a subset of positions of Sprague-Grundy values 0 and 1. This result also shows that, as established in [14], the miserability is quite common in impartial games.This paper continues our investigations of variants of Euclid and related questions; see [3, 15, 16].


## 2. On the𝒫-Positions

We show in this section that the two gamesG1 and G2 have the same 𝒫-positions. We then present a periodicity property of 𝒫-positions and some special classes of 𝒫-positions.Lemma 2.1.
Leta≤b≤c. In the game G2, if (a,b,c)∈𝒫 then c<a+b.Proof.
Assume by contradiction that there exists a𝒫-position (a,b,c) with a≤b≤c and c≥a+b. Then (a,b,c-a)∈𝒩. There must be a move from (a,b,c-a) to some 𝒫-position p. As c-a≥b, the position p must be of the form (a,b,c-a-ia) for some i≥1. This is a contradiction as there is then a move from (a,b,c) to p.Theorem 2.2.
The𝒫-positions in the game G2 are identical to those in the game G1.Proof.
LetA,B be the sets of 𝒫-positions and 𝒩-positions, respectively, of the game G2. We prove that the following two properties hold for the game G1:(i)
every move from a position inA terminates in B;(ii)
from every position inB, there exists a move that terminates in A.Since every move in G2 is legal in G1, (ii) holds. Assume by contradiction that (i) does not hold for G1. Then there exists a position (a,b,c)∈A with a≤b≤c and a move in G1 leading (a,b,c) to some position in A. This move cannot be a 1–3 move as (i) holds for G2, and so this move must be a 1-2 move. Therefore, there exists i≥1 such that (a,b-ia,c)∈A. By Lemma 2.1, c<a+b-ia≤b giving a contradiction. Therefore, (i) holds for G1.Lemma 2.3.
Leta≤b. For the two games G1 and G2, there exists exactly one integer c≥1 in each residue class r(moda) such that (a,b,c)∈𝒫.Proof.
We will prove the existence for the gameG2 and the uniqueness for the game G1. The lemma then follows Theorem 2.2. For the existence, let d be an integer such that a≤b≤d and d≡rmoda. Consider the position (a,b,d) in the game G2. If 𝒢(a,b,d)=0 then we are done. If 𝒢(a,b,d)>0 then there exists a move from (a,b,d) to some 𝒫-position p. This move must be a 1–3 move, and so p is of the form (a,b,d-ia) as required. For the uniqueness, assume by contradiction that there are two positive integers c1<c2 in the residue class r(moda) such that both (a,b,c1) and (a,b,c2) are 𝒫-positions in the game G1. Since c1,c2 are in the same residue class rmoda, we have c2>a. If c2<b then there exists a 1-2 move from (a,c2,b) to (a,c1,b). This is a contradiction. If c2≥b then there exists a 1–3 move from (a,b,c2) to (a,b,c1). This is a contradiction. Therefore, the uniqueness holds.We now present a periodicity result for the𝒫-positions. Note that the following theorem holds for both games by Theorem 2.2.Theorem 2.4.
Leta≤b≤c. Then (a,b,c)∈𝒫 if and only if (a,b+a,c+a)∈𝒫.Proof.
By Theorem2.2, it is enough to prove that the theorem holds for G2. For the necessary condition, let (a,b,c)∈𝒫, let m=⌊b/a⌋, the integer part of b/a, and let r denote the remainder, r=b-ma. Note that c<a+b by Lemma 2.1. By Lemma 2.3, there is exactly one integer n such that p=(a,na+r,c+a)∈𝒫. We show that n=m+1. First assume that n≤m. We have na+r+a≤ma+r+a=b+a≤c+a. However, as p∈𝒫, by Lemma 2.1, a+na+r>c+a giving a contradiction. Next, assume that n≥m+2 and so na+r≥b+2a. Note that a+b>c by Lemma 2.1 and so na+r>c+a. Consider the position q=(a,b+a,c+a). Since there exists a move from p=(a,c+a,na+r) to q, we have q∈𝒩 and so (a,b+a,c+a-ja)∈𝒫 for some positive integer j. By Lemma 2.1, we have b+a<a+c+a-ja which implies j=1, as b+a>c, and so (a,b+a,c)∈𝒫. Note that b+a>c and so there is a move from (a,b+a,c) to (a,b,c) which is also a 𝒫-position. This is a contradiction.
Conversely, assume that(a,b+a,c+a)∈𝒫. By Lemma 2.1, we have c+a<a+b+a or c<a+b. Since there exists a 1–3 move from (a,b+a,c+a) to (a,c,b+a), we have (a,c,b+a)∈𝒩. Then there exists a move from (a,c,b+a) to some 𝒫-position p′. Since b+a>c, p′ must be of the form (a,b+a-ja,c) for some j≥1. By Lemma 2.1, we have a+b+a-ja>c, and so j=1. Therefore, (a,b,c)∈𝒫.Collins and Lengyel [11] suggested a similar result for the game 3-Euclid. They claimed that in the game 3-Euclid, if b,c>a2 then (a,b,c)∈𝒫 if and only if (a,b+a,c+a)∈𝒫. To our knowledge, a proof for this claim has not appeared in the literature. In our opinion, a proof for this claim would be much more complicated.We now solve some special cases for𝒫-positions.Corollary 2.5.
Leta≤b. Then (a,b,b)∈𝒫.Proof.
By Theorem2.2, it is enough to prove that (a,b,b)∈𝒫 in G2.
Assume by contradiction that(a,b,b)∈𝒩. Then there exists a positive integer i such that (a,b-ia,b)∈𝒫. By Lemma 2.1, b<a+b-ia≤b giving a contradiction. Therefore, (a,b,b)∈𝒫.We state one further result, whose proof we postpone until the end of the next section.Proposition 2.6.
(i)  Let2≤a≤b. Then (a,b-1,b)∈𝒫 if and only if gcd(a,b)≠1.
(ii)  Leta<b. Then (a,b-a,b-1)∈𝒫 if and only if gcd(a,b)=1.


## 3. The Positions of Sprague-Grundy Value 1

In this section, we first give some basic results on the Sprague-Grundy function of the gameG2 before showing that the two games G1 and G2 have the same set of positions of Sprague-Grundy value 1. We then show that there is a bridge between the set of 𝒫-positions and the set of positions of Sprague-Grundy value 1. Next, we present two theorems on the periodicity of positions of Sprague-Grundy value 1. Finally, we solve the Sprague-Grundy function for some special cases.Lemma 3.1.
Leta≤b≤c. In the game G2, if 𝒢(a,b,c)=1 then (a,b,c-a)∈𝒫.Proof.
Assume by contradiction that(a,b,c-a)∉𝒫. Then 𝒢(a,b,c-a)>1, and so there exists a move from (a,b,c-a) to some position p of Sprague-Grundy value 1. If c-a≥b, p must be of the form (a,b,c-a-ia) for some i≥1. This is a contradiction as there exists a move from (a,b,c) to p. Therefore, c-a<b. Moreover, since 𝒢(a,b,c)=1, there exists a move from (a,b,c) to some 𝒫-position q. So q must be of the form (a,b,c-ia) for some i≥1. Since (a,b,c-a)∉𝒫, we have i≥2, and so a+c-ia≤c-a<b. However, by Lemma 2.1, a+c-ia>b giving a contradiction. Therefore, (a,b,c-a)∈𝒫.Lemma 3.2.
Leta≤b≤c. In the game G2, if 𝒢(a,b,c)=1 then c<2a+b.Proof.
This is immediate from Lemmas2.1 and 3.1.Lemma 3.3.
Leta≤b≤c. In the game G2,(i)
ifc>a+b then 𝒢(a,b,c)≥2;(ii)
ifc<a+b then 𝒢(a,b,c)≤1.Proof.
The proof is by induction onc. One can check by hand that the lemma is true for c≤3. Assume that the lemma is true for c≤n for some n≥3, we will show that the lemma is true for c=n+1. Note that if b=c then the lemma is true by Corollary 2.5. Therefore, it is sufficient to prove the lemma for a≤b<c=n+1.
For (i), assume by contradiction that there exista≤b such that a+b<c and 𝒢(a,b,c)≤1. By Lemma 2.1, we have 𝒢(a,b,c)≠0 and so 𝒢(a,b,c)=1. By Lemma 3.1, we have (a,b,c-a)∈𝒫. Since c>a+b, we have c-2a>0. As 𝒢(a,b,c)=1, by Lemma 3.2, we have c-2a<b. Consider the position (a,c-2a,b). We have a+c-2a=c-a>b. Note that b≤n. By the inductive hypothesis on (ii), we have 𝒢(a,c-2a,b)≤1. Note that there exists a move from (a,b,c) whose Sprague-Grundy value is 1 to (a,c-2a,b) and so 𝒢(a,c-2a,b)≠1. Also note that there exists a move from (a,b,c-a)∈𝒫 to (a,c-2a,b) and so 𝒢(a,c-2a,b)≠0, giving a contradiction. Thus, (i) is true for c=n+1.
For (ii), assume by contradiction that there exista,b such that a≤b<c, c<a+b and 𝒢(a,b,c)≥2. Then there exist integers i,j≥1 such that 𝒢(a,b,c-ia)=0 and 𝒢(a,b,c-ja)=1. Since 𝒢(a,b,c-ia)=0, by Lemma 2.1, a+c-ia>b. Note that c-a<b and so i=1. This also implies that j≥2. We claim that j=2. Assume by contradiction that j≥3. Then 2a+c-ja≤c-a<b. If c-ja<a, since 𝒢(c-ja,a,b)=1, by Lemma 3.2, 2(c-ja)+a>b. However, c-ja<a also implies 2(c-ja)+a<2a+c-ja giving a contradiction. If a≤c-ja, since 𝒢(a,c-ja,b)=1, by Lemma 3.2, 2a+c-ja>b giving a contradiction. Therefore, j=2. Note that c-2a<b. Now consider the position (a,c-2a,b). Since a+c-2a=c-a<b and b<n+1, by the inductive hypothesis on (i), we have 𝒢(a,c-2a,b)≥2 giving a contradiction. Therefore, (ii) is true for c=n+1.
Thus, by the inductive principle, the lemma is true.Question 1.
Leta≤b be positive integers. What is the relationship between a,b so that 𝒢(a,b,a+b)=1?By the part (i) of Lemma3.3, we have a result stronger than Lemma 3.2 as follows.Corollary 3.4.
Leta≤b≤c. In the game G2, if 𝒢(a,b,c)=1 then c≤a+b.We are now in the position to show that all results early in this section are also true for the gameG1.Theorem 3.5.
The positions of Sprague-Grundy value 1 in the gameG2 are identical to those in the game G1.Proof.
LetA be the set of positions of Sprague-Grundy value 1 in the game G2. We show that the following two properties hold for G1:(i)
there is no move from a position inA to a position in A,(ii)
from every position that is not in𝒫∪A, there is a move to a position in A.Note that every move in G2 is also legal in G1 and so (ii) holds for G1. Assume by contradiction that (i) does not hold for G1. Then, there exist a position p=(a,b,c)∈A with a≤b≤c and a 1-2 move from p to some position q∈A. This implies that q=(a,b-ia,c) for some i≥1. By Corollary 3.4, we have c≤a+b-ia≤b implying c=b. But if c=b then, by Corollary 2.5, (a,b,c)∈𝒫 giving a contradiction. Therefore (i) holds.In the next part, we find some connections between the𝒫-positions and the set of positions of Sprague-Grundy value 1.Corollary 3.6.
Leta≤b≤c. For the two games G1 and G2, if 𝒢(a,b,c)=1 then (a,b,c-a)∈𝒫 and (a,c,b+a)∈𝒫.Proof.
We work with the gameG2. By Lemma 3.1 and Theorem 3.5, (a,b,c-a)∈𝒫. So it remains to show that (a,c,b+a)∈𝒫. Note that c≤a+b by Corollary 3.4. Assume by contradiction that (a,c,b+a)∉𝒫. Then there exists a move from (a,c,b+a) to some 𝒫-position p. So p must be of the form (a,c,b+a-ia) for some i≥1. Since 𝒢(a,b,c)=1, we must have i≥2, and so a+b+a-ia≤b≤c. But as (a,c,b+a-ia)∈𝒫, by Lemma 2.1, we have a+b+a-ia>c giving a contradiction. Therefore, (a,c,b+a)∈𝒫.The following corollary is the converse of Corollary3.6 when b<c.Corollary 3.7.
Leta≤b<c. If (a,b,c)∈𝒫, then 𝒢(a,c-a,b)=1 and 𝒢(a,c,b+a)=1.Proof.
By Lemma2.1, we have a+b>c. We first prove that 𝒢(a,c-a,b)=1. Assume by contradiction that 𝒢(a,c-a,b)≠1. Then 𝒢(a,c-a,b)>1. By Lemma 3.3, b≥a+c-a=c giving a contradiction. Therefore, 𝒢(a,c-a,b)=1.
We now prove that𝒢(a,c,b+a)=1. Assume by contradiction that 𝒢(a,c,b+a)≠1. Then 𝒢(a,c,b+a)>1. There exists a move from (a,c,b+a) to some position p of Sprague-Grundy value 1. So, working in G2, p must be of the form (a,c,b+a-ia) for some i≥1. Since p≠(a,b,c), we have i≥2 and so a+b+a-ia≤b<c. But by Lemma 3.3, 𝒢(a,c,b+a-ia)≥2 giving a contradiction. Therefore, 𝒢(a,c,b+a)=1.Note that Corollary3.7 does not hold for b=c. For example, for a=1,b=3, we have 𝒢(a,b,b)=0 for both games but 𝒢(a,b-a,b)=3 for the game G1 and 𝒢(a,b-a,b)=2 for the game G2. For a=1,b=2, we have 𝒢(a,b,b)=0 for both games but 𝒢(a,b,b+a)=3 for the game G1 and 𝒢(a,b,b+a)=2 for the game G2. An answer for Question 1 would also provide a criteria for the case b=c to hold in Corollary 3.7.We now present two theorems giving periodicity of positions of Sprague-Grundy value 1 of the forms(a,b,c) with a+b>c and of the form (a,b,a+b).Theorem 3.8.
Leta≤b≤c and a+b>c. Then 𝒢(a,b,c)=1 if and only if 𝒢(a,b+a,c+a)=1.Proof.
Assume that𝒢(a,b,c)=1. By Corollary 3.6, we have (a,c,b+a)∈𝒫. By Corollary 3.7, we have 𝒢(a,b+a,c+a)=1. Now assume that 𝒢(a,b+a,c+a)=1. By Corollary 3.6, we have (a,c,b+a)∈𝒫. By Corollary 3.7, we have 𝒢(a,b,c)=1.The previous theorem does not hold forc=a+b. For example, 𝒢(1,3,4)=1, but 𝒢(1,4,5)=2 for the game G2. Nevertheless, one has the following.Theorem 3.9.
Leta≤b. Then 𝒢(a,b,a+b)=1 if and only if 𝒢(a,b+2a,b+3a)=1.Proof.
It is sufficient to prove that the theorem holds for the gameG2. We first prove the necessary condition. Assume by contradiction that 𝒢(a,b+2a,b+3a)≠1. By Lemma 2.1, 𝒢(a,b+2a,b+3a)≠0. Then, 𝒢(a,b+2a,b+3a)≥2 and so there exists a move from (a,b+2a,b+3a) to some position p of Sprague-Grundy value 1. So p must be of the form (a,b+2a,b+3a-ia) for some i≥1. We claim that i=2. By Corollary 2.5, (a,b+2a,b+2a)∈𝒫, so i≠1. If i≥3, then a+b+3a-ia≤b+a<b+2a and so 𝒢(a,b+2a,b+3a-ia)≥2 by Lemma 3.3. So i=2. But this is impossible as there exists a move from p to the position (a,b,a+b). Therefore, 𝒢(a,b+2a,b+3a)=1.
Conversely, assume that𝒢(a,b+2a,b+3a)=1. Then 𝒢(a,b+a,b+2a)≠1. Note that (a,b+a,b+a)∈𝒫 by Corollary 2.5. Since there exists a move from (a,b+a,b+2a) to (a,b+a,b+a), 𝒢(a,b+a,b+2a)≥2. It follows that there exists a move from (a,b+a,b+2a) to some position q of Sprague-Grundy value 1. So q must be of the form (a,b+a,b+2a-ia) for some i≥1. We claim that i=2. Note that i≠1 as (a,b+a,b+a)∈𝒫. If i≥3 then a+b+2a-ia≤b<b+a, and so, by Lemma 3.3, we have 𝒢(q)≥2 giving a contradiction. Hence i=2 and 𝒢(a,b,b+a)=1.We now present some special classes of positions of Sprague-Grundy value 1. The following corollary follows from the above theorem by induction ona.Corollary 3.10.
𝒢(1,a,a+1)=1 if and only if a is odd.Proposition 3.11.
(i) Let2≤a≤b. Then 𝒢(a,b-1,b)=1 if and only if gcd(a,b)=1.
(ii) Let2≤a<b. Then 𝒢(a,b-a,b-1)=1 if and only if gcd(a,b)≠1.Proof.
Note that (ii) follows from (i) by Corollary3.6 and Lemma 3.3. Therefore, it is sufficient to prove (i). We prove (i) by induction on b. It can be checked that (i) holds for b=2,3. Assume that (i) holds for b≤n for some n≥3. We now show that (i) holds for b=n+1. If a=b then 𝒢(a,b-1,b)=0 by Corollary 2.5. Therefore, (i) holds for a=b. We claim that (i) also holds for a=b-1. Note that 𝒢(1,a,a)=0 by Corollary 2.5 and the only move from (a,a,a+1) is to (1,a,a). Therefore, 𝒢(a,a,a+1)=1 by definition. Also note that gcd(a,a+1)=1. Therefore, (i) holds for a=b-1. Let 2≤a≤b-2. We show that 𝒢(a,b-1,b)=1 if and only if gcd(a,b)=1.
Suppose that𝒢(a,b-1,b)=1. By Corollary 3.6, 𝒢(a,b-a,b-1)=0. We compare a with b-a. We claim that a≠b-a. In fact, if a=b-a then 𝒢(b-1-a,a,b-a)=0 by Corollary 2.5, but there exists a move from (a,b-a,b-1) to (b-1-a,a,b-a). This is impossible. Hence a≠b-a. If a<b-a, then 𝒢(a,b-1-a,b-a)=1 by Corollary 3.7. Since b-a<n, the inductive hypothesis gives gcd(a,b-a)=1, and so gcd(a,b)=1. If b-a<a, then 𝒢(b-a,a,b-1-(b-a))=1 by Corollary 3.7; that is, 𝒢(b-a,a-1,a)=1. Since a<n and b-a≥2, the inductive hypothesis gives gcd(b-a,a)=1 and so gcd(a,b)=1.
Conversely, suppose thatgcd(a,b)=1. Assume by contradiction that 𝒢(a,b-1,b)≠1. Then 𝒢(a,b-1,b)=0 by Lemma 3.3. By Corollary 3.7, we have 𝒢(a,b-a,b-1)=1. We compare a with b-a. Note that a≠b-a as gcd(a,b)=1. If a<b-a, then 𝒢(a,b-1-a,b-a)=0 by Corollary 3.6. As b-a<n, by the inductive hypothesis, gcd(a,b-a)≠1 giving a contradiction. If b-a<a, then 𝒢(b-a,a,b-1-(b-a))=0 by Corollary 3.6; that is, 𝒢(b-a,a-1,a)=0. Since a<n and b-a≥2, by the inductive hypothesis, gcd(b-a,a)≠1, and so gcd(a,b)≠1 giving a contradiction. Therefore, 𝒢(a,b-1,b)=1.As promised at the end of the previous section, we now give the following.Proof of Proposition2.6.
Fora≥2, Proposition 2.6 follows immediately from Proposition 3.11 and Lemma 3.3. For a=1, Proposition 2.6(ii) follows from Corollary 2.5.


## 4. On the Partition of Sprague-Grundy Values

This section extends a result from Collins and Lengyel’s work on the game 3-Euclid. Leta≤b, and let s be a nonnegative integer. We answer the question as to whether there exists a positive integer c such that 𝒢(a,b,c)=s and whether such an existence is unique.Theorem 4.1.
Leta≤b, and let s be a nonnegative integer. For the game G1, there exists exactly one integer c≥1 in each residue class r(moda) such that 𝒢(a,b,c)=s.Proof.
The result holds fors=0 by Lemma 2.3. So we may assume that s>0.
For the uniqueness, assume by contradiction that there are two positive integersc1<c2 in the residue class r(moda) such that 𝒢(a,b,c1)=𝒢(a,b,c2). Since c1,c2 are in the same residue class modulo a, we have c2>a. If c2<b then there exists a 1-2 move from (a,c2,b) to (a,c1,b). This is a contradiction. If c2≥b then there exists a 1–3 move from (a,b,c2) to (a,b,c1). This is a contradiction. Therefore, the uniqueness holds.
For the existence, assume by contradiction that there is no integerc in the residue class r(moda) such that 𝒢(a,b,c)=s. Let m=⌊b/a⌋ and let d be an integer such that d≥b and d≡r(moda). Let b0=b-ma. There are two cases for b0.
Ifb0=0, we consider the sequence of positions
(4.1)(a,b,d+a),(a,b,d+2a),…,(a,b,d+(s+m)a).
Note that each pair of theses+m positions has distinct Sprague-Grundy values, and so there are at most s positions having Sprague-Grundy values from 0 to s-1. Consequently, there are, in that sequence, at least m positions having Sprague-Grundy values more than s. Assume that these m positions are
(4.2)(a,b,d+i1a),(a,b,d+i2a),…,(a,b,d+ima).
From each position (a,b,d+ija), there exists a move to some position pj of Sprague-Grundy value s. This move must be a 1-2 move, and so pj must be of the form (a,b-kja,d+ija). Since there are at most m-1 values for kj (as b-kja>0) while there are m positions pj, there must be two distinct positions pj1=(a,b-kj1a,d+ij1a) and pj2=(a,b-kj2a,d+ij2a) having the same Sprague-Grundy value s in which kj1=kj2 and ij1≠ij2. This is a contradiction as there is a 1–3 move (as b-kja≥a) from one of the two positions pj1,pj2 to the other.
Ifb0>0, we consider the sequence of positions
(4.3)(a,b,d+b0a),(a,b,d+2b0a),…,(a,b,d+(s+m+1)b0a).
This sequence contains at leastm+1 positions having Sprague-Grundy values greater than s. Assume that these m+1 positions are
(4.4)(a,b,d+i1b0a),(a,b,d+i2b0a),…,(a,b,d+im+1b0a).
From each position (a,b,d+ijb0a), there exists a move to some position qj of Sprague-Grundy value s. This move must be a 1-2 move and so qj must be of the form (a,b-kja,d+ijb0a). Since there are at most m values for kj while there are m+1 positions qj, there must be two distinct positions qj1=(a,b-kj1a,d+ij1b0a) and qj2=(a,b-kj2a,d+ij2b0a) having the same Sprague-Grundy value s in which kj1=kj2 and ij1≠ij2. If b-kj1a≥a then there exists a 1–3 move from one of two positions qj1,qj2 to the other. This is a contradiction. Therefore, b-kj1a<a and so b-kj1a=b0, and the two integers d+ij1b0a and d+ij2b0a are in the same residue class d(modb0). Thus, there are two distinct integers d+ij1b0a,d+ij2b0a in the residue class d(modb0) satisfying 𝒢(b0,a,d+ij1b0a)=𝒢(b0,a,d+ij2b0a). This contradicts the uniqueness part of the theorem. Therefore, the existence holds.Theorem 4.2.
Leta≤b, and let s be a nonnegative integer. For the game G2, in each residue class r(moda), there exists at least one integer c≥1 such that 𝒢(a,b,c)=s.Proof.
By Lemma2.3, we may assume that s>0. Let d be an integer such that d≥b and d≡rmoda. Consider the sequence of positions
(4.5)(a,b,d),(a,b,d+a),(a,b,d+2a),…,(a,b,d+sa).
Note that each pair of these s+1 positions has distinct Sprague-Grundy values and so there are at most s positions having Sprague-Grundy values from 0 to s-1. Therefore, if none of these positions has Sprague-Grundy value s then there exists at least one of these positions having Sprague-Grundy value more than s, say (a,b,d+ia). Then there exists a 1–3 move from (a,b,d+ia) to some position 𝒢(a,b,d+(i-j)a) of Sprague-Grundy value s, as required.In Theorem4.2, the existence of c is not unique. For example, the three positions (4,4,19),(4,8,19), and (4,12,19) have the same Sprague-Grundy value 4. Whenever the existence of the value c is not unique, we have the following observation on the values c for the game G2. We have checked this result as far as b=100.Observation 1.
Leta≤b. In the game G2, if there are two values c1,c2 in the same residue class modulo a such that 𝒢(a,b,c1)=𝒢(a,b,c2) then a≤c1,c2<b,b≥3a, and c1,c2 are both multiples of a.


## 5. Miserability

In this section, we examine the misère versions of two gamesG1 and G2. Recall that an impartial game is under misère convention if the player making the last move loses. A game can be described by a finite directed acyclic graph Γ without multiple edges in which each vertex is a position, and there is a downward edge from p to q if and only if there is a move from the position p to the position q. Moreover, the graph can be assumed to have only one source. A source is a vertex with no incoming edges. The source of the graph is the original position of the game. The sinks are the vertices with no outgoing edges, so the sinks of the graph are the final (terminal) positions of the game. For convenience, a graph of a game is assumed to have precisely one sink. This is because when the graph has more than one sink, they can be coalesced together into one sink without changing the properties of the game.LetG be an impartial game and Γ the corresponding digraph of the game G. The misère version of the game G can be considered as the graph obtained from Γ by adding an extra vertex v0 and a move from the sink of Γ to v0 [13]. In [14], a game is said to be miserable if its normal and misère versions are different only on some subset of positions of Sprague-Grundy values 0 and 1. More precisely, a game 𝒢 is miserable if there exist subsets V0 of 𝒫-positions and V1 of positions of Sprague-Grundy value 1 so that the two functions 𝒢 and 𝒢- swap on positions in V0 and V1 and are equal on other positions. Here 𝒢 and 𝒢- are the Sprague-Grundy functions for the game G and its misère version respectively. If V0 is equal to the set of 𝒫-positions and V1 is equal to the set of positions of Sprague-Grundy value 1 then the game is said to be strongly miserable. We will show that the two games G1 and G2 are miserable but not strongly miserable. Before presenting this result, let us discuss some properties of positions of Sprague-Grundy values 0 and 1 of the misère versions. The proofs for the following results are similar to those in previous sections.Lemma 5.1.
Leta≤b≤c. In the misère versions,(i)
ifc>a+b then 𝒢(a,b,c)≥2;(ii)
ifc<a+b then 𝒢(a,b,c)≤1.Theorem 5.2.
The𝒫-positions of the misère version of G2 are identical to those of the misère version of G2.Theorem 5.3.
The positions of Sprague-Grundy value 1 in the misère version ofG2 are identical to those in the misère version of G1.Some properties of periodicity of𝒫-positions and positions of Sprague-Grundy value 1 of the two games G1 and G2 are still true for their misère versions.Theorem 5.4.
Leta≤b≤c such that (a,b,c)≠(a,a,2a). In the misère versions of G1 and G2, if (a,b,c)∈𝒫 then (a,b+a,c+a)∈𝒫.Theorem 5.5.
Leta≤b≤c such that a+b>c and (a,b,c)≠(a,2a,2a). In the misère versions of G1 and G2, if (a,b,c) has Sprague-Grundy value 1 then (a,b+a,c+a) has Sprague-Grundy value 1.Theorem 5.6.
Leta≤b. In the misère versions of G1 and G2, if (a,b,a+b) has Sprague-Grundy value 1 then (a,b+2a,b+3a) has Sprague-Grundy value 1.We now come back with the main result of this section. Note that the following theorem is also true forG2 by Theorems 5.2 and 5.3.Theorem 5.7.
The gameG1 is miserable.Proof.
Consider the graphΓ1- with the sink v0 of the misère version. For each vertex (position) v, the heighth(v) of v is the length of the longest directed path from v to the sink v0. We will prove by induction on h(v) that if either 𝒢1(v)≥2 or 𝒢1-(v)≥2 then 𝒢1-(v)=𝒢1(v). Note that the claim is true for h(v)=1. Assume that the claim is true for h(v)≤n for some n≥1. We show that the claim is true for h(v)=n+1.
We first assume that𝒢1(v)≥2. For each k<𝒢1(v), there exists wk such that 𝒢1(wk)=k and one can move from v to wk. By the inductive hypothesis, 𝒢1-(w0),𝒢1-(w1)≤1, and if there is a move from v to some w with 𝒢1(w)≥2 then 𝒢1-(w)=𝒢1(w). It remains to show that 𝒢1-(w0)≠𝒢1-(w1). We show that there is a move between w0,w1 in the misère version of G1. Assume that v=(a,b,c). There are three following possibilities for moves from v to w0,w1:
(i)
w0=(a,b,c-ia),w1=(a,b,c-ja);(ii)
w0=(a,b-ia,c),w1=(a,b-ja,c);(iii)
eitherw0=(a,b,c-ia),w1=(a,b-ja,c) or w0=(a,b-ia,c),w1=(a,b,c-ja). One can check that there is a move between w0,w1 for the first two possibilities. We show that the third possibility does not occur. In fact, consider the assumption w0=(a,b,c-ia),w1=(a,b-ja,c) (the other case can be treated similarly). By Lemma 5.1, we have a+b-ja≤c, and so j=1,b=c. Note that a+c-ia≥b by Lemma 5.1 and so i=1. Consequently, w0=w1 giving a contradiction. Hence, 𝒢1-(v)=𝒢1(v). Similarly, we can show that if 𝒢1-(v)≥2 then 𝒢1(v)=𝒢1-(v). This completes the proof.Note that the gameG1 (and so G2) is not strongly miserable. A counterexample is the position (1, 3, 3) which is a 𝒫-position in G1 and its misère version.



---

*Source: 406250-2012-02-06.xml*