In the classical game of Nim two players take turns removing stones from piles. A player may remove any positive number of stones from a single pile. If there are no remaining stones, the next player to move loses.
In Factorisation Nim the initial position of the game is chosen according to the prime factorisation of a given natural number by setting a pile for each prime factor, including multiplicity. For example, if the game starts with three piles: two piles with two stones and one pile with three stones.
It can be verified that the first player to move loses for and for , assuming both players play optimally.
Let be the sum of for such that the first player to move loses, assuming both players play optimally. You are given and .