sum of binary digit representation of n, mod 2
0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, ...
repeatedly apply the replacement rule {0->01, 1->10} on 0
a_n = Mod[Total[IntegerDigits[n, 2]], 2]
Table[Mod[Total[IntegerDigits[k, 2]], 2], {k, 0, n}]