a property of bitwise xor sum.

if com(i) = 0^1^2^…..^i then

com(i) is defined as follows :

int com(int i){
 int a[] = {i, 1, i+1, 0};
 return a[i%4];
}

and the value of (i)^(i+1)^….^(j) is :

com(j)^com(i-1).

Advertisements

Famous Sequences of Grundy values.

Seq id: A025480.
Seq definition: a(2n) = n, a(2n+1) = a(n).

Seq first terms: 0, 0, 1, 0, 2, 1, 3, 0, 4, 2, 5, 1, 6, 3, 7, 0, 8, 4, 9, 2, 10, 5, 11, 1, 12, 6, 13, 3, 14, 7, 15, 0, 16, 8, 17, 4, 18, 9, 19, 2, 20, 10, 21, 5, 22, 11, 23, 1, 24, 12, 25, 6, 26, 13, 27, 3, 28, 14, 29, 7, 30, 15, 31, 0, 32, 16, 33, 8, 34, 17, 35, 4, 36, 18, 37, 9, 38, 19, 39, 2, 40, 20, 41, 10

https://oeis.org/A025480