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.
%I A316632 #53 May 24 2021 09:44:39 %S A316632 2,1,1,0,3,3,2,2,2,3,3,5,2,4,1,3 %N A316632 a(n) is the Sprague-Grundy value of the Node-Kayles game on the 3 X n lattice graph. %C A316632 The Node-Kayles game on the 1 X n lattice graph (i.e., path) is equivalent to the Dawson's chess game and thus produces the same Sprague-Grundy values as A002187. %C A316632 The Node-Kayles game on the 2 X n lattice graph (i.e., ladder graph) produces the Sprague-Grundy values 1,0,1,0,1,0,..., which are periodic with period 2 (A000035). %C A316632 The Node-Kayles game on the 4 X n lattice graph produces the Sprague-Grundy values 0,0,0,0,0,..., which are constantly 0 (A000004). %D A316632 E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays, Volume 1, A K Peters, 2001. %H A316632 Sierra Brown, Spencer Daugherty, Eugene Fiorini, Barbara Maldonado, Diego Manzano-Ruiz, Sean Rainville, Riley Waechter, and Tony W. H. Wong, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL23/Wong/wong24.html">Nimber Sequences of Node-Kayles Games</a>, J. Int. Seq., Vol. 23 (2020), Article 20.3.5. %H A316632 Max Fan, <a href="https://github.com/InnovativeInventor/node-kayles">Generalized Node-Kayles calculator implemented in Rust</a> %H A316632 Riley S. Waechter, <a href="/A316632/a316632_1.txt">Python program</a> %e A316632 a(1) is the Sprague-Grundy value of the Node-Kayles game played on the 3 X 1 lattice graph, which is a path of length 3. Hence, a(1)=2, which is the third term in the sequence A002187. %e A316632 a(2) is the Sprague-Grundy value of the Node-Kayles game played on the 3 X 2 lattice graph, which is a ladder with three rungs. The first player has two possible moves: to color the a corner vertex, which has degree 2, or to color a vertex with degree 3. If the player colors a vertex of degree 2, the resultant graph is a path of length 3. As mentioned before, the Sprague-Grundy value of the Node-Kayles game played on a path of length 3 is 2. If the player colors a vertex of degree 3, the resultant graph consists of two isolated vertices. The Sprague-Grundy value of the Node-Kayles game played on two isolated vertices is 0. Hence, a(2) = mex{0,2} = 1, where mex is the minimum excluded function. %o A316632 (Rust) // See Fan link. - _Max Fan_, May 23 2021 %o A316632 (Haskell) %o A316632 pickCoords n = sequence [[0,1,2], [0..n-1]] %o A316632 mex list = head (filter (`notElem` list) [0..(maximum list+1)]) %o A316632 checkAdj [x,y] [n,m] = not ((x==n && abs(y-m) <= 1) || (y==m && abs (x-n) <= 1)) %o A316632 nextMoves max history = filter (\move -> null history || all (checkAdj move) history) (pickCoords max) %o A316632 calcNimber max history | null (nextMoves max history) = 0 | otherwise = mex (map (\move -> calcNimber max (history ++ [move])) (nextMoves max history)) %o A316632 a316632 n = calcNimber n [] -- _Max Fan_, May 23 2021 %Y A316632 Cf. A000004, A000035, A002187. %K A316632 nonn,more %O A316632 1,1 %A A316632 _Sierra Brown_, _Spencer Daugherty_, _Eugene Fiorini_, _Barbara Maldonado_, _Sean E. Rainville_, _Riley S. Waechter_, _Wing Hong Tony Wong_, Jul 13 2018 %E A316632 a(14)-a(16) from _Max Fan_, May 23 2021