A344227 Sprague-Grundy value for the Node-Kayles game played on the n-queens graph.
0, 1, 1, 2, 1, 3, 1, 2, 3, 1, 0, 1, 0, 1
Offset: 0
References
- G. Schrage, The eight queens problem as a strategy game, Int. J. Math. Educ. Sci. Technol. 17 (1989) 143-148. (mentions a restricted form of the Non-Attacking Queens game).
Links
- Matthew Bardoe, Non-Attacking Queens implementation in Python on Torus and non-Torus Chessboards.
- Max Fan, Generalized Node-Kayles calculator implemented in Rust (terms 0 and terms 11-13 from Max Fan).
- H. Noon, Surreal Numbers and the N-Queens Game, Bennington College, 2002 (includes this sequence).
- H. Noon and G. Brummelen, The Non-Attacking Queens Game, The College Mathematics Journal., 224 (2006), 223-227 (Original problem description, terms 1-10 from H. Noon).
Programs
-
Haskell
pickCoords n = sequence (replicate 2 [0..n-1]) mex list = head (filter (`notElem` list) [0..(maximum list+1)]) checkIntersect [x,y] [n,m] = not (x == n || y == m) && (abs (x-n) /= abs (y-m)) nextMoves max history = filter (\move -> null history || all (checkIntersect move) history) (pickCoords max) calcNimber max history | null (nextMoves max history) = 0 | otherwise = mex (map (\move -> calcNimber max (history ++ [move])) (nextMoves max history)) a344227 n = calcNimber n []
-
Rust
// See Fan link.
Comments