In number theory, an odious number is a positive integer that has an odd number of 1s in its binary expansion.
In computer science, an odious number is said to have odd parity.
The first odious numbers are:
If denotes the th odious number (with ), then for all , .
Every positive integer has an odious multiple that is at most . The numbers for which this bound is tight are exactly the Mersenne numbers with even exponents, the numbers of the form , such as 3, 15, 63, etc. For these numbers, the smallest odious multiple is exactly .
The odious numbers give the positions of the nonzero values in the Thue–Morse sequence. Every power of two is odious, because its binary expansion has only one nonzero bit. Except for 3, every Mersenne prime is odious, because its binary expansion consists of an odd prime number of consecutive nonzero bits.
Non-negative integers that are not odious are called evil numbers. The partition of the non-negative integers into the odious and evil numbers is the unique partition of these numbers into two sets that have equal multisets of pairwise sums.