cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A014588 Nim function for Take-a-Fibonacci-Game (a subtraction game).

This page as a plain text file.
%I A014588 #33 Jun 06 2022 11:16:59
%S A014588 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,
%T A014588 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,
%U A014588 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
%N A014588 Nim function for Take-a-Fibonacci-Game (a subtraction game).
%C A014588 This game is also called Fibonacci nim, but there is also a different game with the same name. Its winning positions (the indexes of zeros in this sequence) are A001581 and its (much sparser) odd winning positions are A120904. - _David Eppstein_, Jun 14 2018
%C A014588 Concerning the January 1997 dissertation of Achim Flammenkamp, his home page (currently http://wwwhomes.uni-bielefeld.de/cgi-bin/cgiwrap/achim/index.cgi) has the link shown below, and a comment that a book was published in July 1997 by Hans-Jacobs-Verlag, Lage, Germany with the title Lange Perioden in Subtraktions-Spielen (ISBN 3-932136-10-1). This is an enlarged study (more than 200 pages) of his dissertation. - _N. J. A. Sloane_, Jul 25 2019
%D A014588 R. K. Guy, Unsolved Problems in Number Theory, E26.
%D A014588 David L. Silverman, Your Move, McGraw Hill, 1971, page 211. Reprinted by Dover Books, 1991 (mentions this game).
%H A014588 Eric M. Schmidt, <a href="/A014588/b014588.txt">Table of n, a(n) for n = 0..10000</a>
%H A014588 Achim Flammenkamp, <a href="http://wwwhomes.uni-bielefeld.de/~achim/diss.ps.gz">Lange Perioden in Subtraktions-Spielen</a>, Dissertation, Dept. Math., University of Bielefeld, Germany.
%H A014588 Wikipedia, <a href="https://en.wikipedia.org/wiki/Sprague%E2%80%93Grundy_theorem">Sprague-Grundy theorem</a>
%o A014588 (Sage)
%o A014588 def A014588(max) :
%o A014588     res = []
%o A014588     for i in range(max+1) :
%o A014588         moves = list({res[i-f] for f in fibonacci_xrange(1,i+1)})
%o A014588         moves.sort()
%o A014588         k = len(moves)
%o A014588         mex = next((j for j in range(k) if moves[j] != j), k)
%o A014588         res.append(mex)
%o A014588     return res
%o A014588 # _Eric M. Schmidt_, Jul 20 2013, corrected _Eric M. Schmidt_, Apr 24 2019
%Y A014588 Cf. A001581, A014586-A014589, A019307, A120904.
%K A014588 nonn
%O A014588 0,3
%A A014588 _Achim Flammenkamp_