In number theory, a pernicious number is a positive integer such that the Hamming weight of its binary representation is prime, that is, there is a prime number of 1s when it is written as a binary number.
[1] The first pernicious number is 3, since 3 = 112 and 1 + 1 = 2, which is a prime.
[2] The sequence of pernicious numbers begins No power of two is a pernicious number.
This is trivially true, because powers of two in binary form are represented as a one followed by zeros.
So each power of two has a Hamming weight of one, and one is not considered to be a prime.
[2] On the other hand, every number of the form
This is because the sum of the digits in binary form is 2, which is a prime number.
has a binary representation consisting of
By the Euclid–Euler theorem, the even perfect numbers take the form
Therefore, every even perfect number is pernicious.