A014588 Nim function for Take-a-Fibonacci-Game (a subtraction game).
0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2
Offset: 0
Keywords
References
- R. K. Guy, Unsolved Problems in Number Theory, E26.
- David L. Silverman, Your Move, McGraw Hill, 1971, page 211. Reprinted by Dover Books, 1991 (mentions this game).
Links
- Eric M. Schmidt, Table of n, a(n) for n = 0..10000
- Achim Flammenkamp, Lange Perioden in Subtraktions-Spielen, Dissertation, Dept. Math., University of Bielefeld, Germany.
- Wikipedia, Sprague-Grundy theorem
Programs
-
Sage
def A014588(max) : res = [] for i in range(max+1) : moves = list({res[i-f] for f in fibonacci_xrange(1,i+1)}) moves.sort() k = len(moves) mex = next((j for j in range(k) if moves[j] != j), k) res.append(mex) return res # Eric M. Schmidt, Jul 20 2013, corrected Eric M. Schmidt, Apr 24 2019
Comments