Scatterstone Nim
Problem 629
Alice and Bob are playing a modified game of Nim called Scatterstone Nim, with Alice going first, alternating turns with Bob. The game begins with an arbitrary set of stone piles with a total number of stones equal to .
During a player's turn, he/she must pick a pile having at least stones and perform a split operation, dividing the pile into an arbitrary set of non-empty, arbitrarily-sized piles where for some fixed constant . For example, a pile of size can be split into or , or if and in addition if .
If no valid move is possible on a given turn, then the other player wins the game.
A winning position is defined as a set of stone piles where a player can ultimately ensure victory no matter what the other player does.
Let be the number of winning positions for Alice on her first turn, given parameters and . For example, with winning positions . In contrast, with winning positions .
Let be the sum of over all . For example, and .
Find mod .