Evil number

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

In number theory, an evil number is a non-negative integer that has an even number of 1s in its binary expansion.

The first evil numbers are:

0, 3, 5, 6, 9, 10, 12, 15, 17, 18, 20, 23, 24, 27, 29, 30, 33, 34, 36, 39 ...[1]

These numbers give the positions of the zero values in the Thue–Morse sequence.

Non-negative integers that are not evil are called odious numbers.

In computer science, an evil number is said to have even parity.


  1. ^ Sloane, N. J. A. (ed.). "Sequence A001969 (Evil numbers: numbers with an even number of 1's in their binary expansion)". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation.