Overview
Important

The Nim-sum is a special way of adding numbers used in the game of Nim and other combinatorial games. It is the same as adding numbers in binary, but without carrying over. In other words, you write the numbers in binary, line them up, and add each column separately, but if you get 2 in a column, you write 0 (since 2 mod 2 = 0). This is also called 'bitwise XOR'.

Important properties

  • Nim-sum is commutative and associative: the order of adding numbers does not matter.

  • The Nim-sum of a number with itself is 0.

  • The Nim-sum of any number with 0 is the number itself.

  • Nim-sum is used to determine winning strategies in the game of Nim.