Evil_number
Evil number
Class of binary number
In number theory, an evil number is a non-negative integer that has an even number of 1s in its binary expansion.[1] These numbers give the positions of the zero values in the Thue–Morse sequence, and for this reason they have also been called the Thue–Morse set.[2] Non-negative integers that are not evil are called odious numbers.
evil |
odious |
The first 16 evil and odious numbers in little-endian binary. It can be seen, that both sequences differ only in the least significant bits, which form the Thue–Morse sequence for the evil, and its negation for the odious numbers. The other bits form the even numbers. |