linearnim
LinearNim is a variation of the game of Nim. In this version, the game is played with a single pile of tokens, and players can remove a number of tokens from the pile. The number of tokens that can be removed is restricted by a set of allowed moves. For instance, if the allowed moves are {1, 3, 4}, a player can choose to remove 1, 3, or 4 tokens from the pile. The player who takes the last token wins.
The game can be analyzed using the Sprague-Grundy theorem, which is a fundamental concept in combinatorial
For LinearNim, the g-number of a pile of size n, denoted g(n), can be calculated recursively. g(n)