Take the parity of the number of 1s in the binary form of n, and you have written — in one breath — one of the most surprising words in mathematics: the Thue-Morse sequence, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, ... First studied by Axel Thue in 1906 for its impossible-sounding property — a binary word with no overlapping repetitions — it reappeared in Morse theory, in radar, in chess rules, and in a 19th-century problem of Prouhet about splitting powers perfectly evenly.
Thue-Morse Sequence Generator computes t(n) by the parity definition for any window you choose, annotates each row with the binary form and bit count, and offers the doubling-rule view in the reference tab.