# A nim-type game and continued fractions

#### Abstract

In the two-person nim-type game called Euclid a position consists of a pair (a, b) of positive integers. Players alternate moves, a move consisting of decreasing the larger number in the current position by any positive multiple of the smaller number, as long as the result remains positive. The first player unable to make a move loses. In the restricted version a set of natural numbers Λ is given, and a move decreases the larger number in the current position by some multiple λ ∈ Λ of the smaller number, as long as the result remains positive. We present winning strategies and tight bounds on the length of the game assuming optimal play. For Λ = Λk = {1, 2, . . . , k}, k ≥ 2, the winner is determined by the parity of the position of the first partial quotient that is different from 1 in a reduced form of the continued fraction expansion of b/a. Apparently, the game was introduced by Cole and Davie [1]. An analysis of the game and more references can be found in [1,7] (see also [3]). The goal is to determine those a and b for which the player who goes first from position (a, b) can guarantee a win with optimal play. There is no tie and the game is finite so one of the players must have a winning strategy for each starting position (a, b). The winning positions are intimately related to the ratio of the larger number to the smaller one when compared to the golden ratio, Φ = 1+ √ 5 2 ≈ 1.6180, as it is demonstrated by

### Cite this paper

@inproceedings{Lengyel2003ANG, title={A nim-type game and continued fractions}, author={Tam{\'a}s Lengyel}, year={2003} }