{{Short description|Number with prime Hamming weight}} 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.<ref>{{citation|first=Elena|last=Deza|author-link=Elena Deza|title=Mersenne Numbers And Fermat Numbers|page=263|publisher=World Scientific|year=2021|isbn=978-9811230332}}</ref>

==Examples== The first pernicious number is 3, since 3&nbsp;=&nbsp;11<sub>2</sub> and 1&nbsp;+&nbsp;1&nbsp;=&nbsp;2, which is a prime. The next pernicious number is 5, since 5&nbsp;=&nbsp;101<sub>2</sub>, followed by 6 (110<sub>2</sub>), 7 (111<sub>2</sub>) and 9 (1001<sub>2</sub>).<ref name=oeis>{{cite OEIS|A052294|mode=cs2}}</ref> The sequence of pernicious numbers begins {{bi|left=1.6|3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 22, 24, ... {{OEIS|A052294}}.}}

==Properties== 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.<ref name=oeis/> On the other hand, every number of the form <math>2^n+1</math> with <math>n>1</math>, including every Fermat number, is a pernicious number. This is because the sum of the digits in binary form is 2, which is a prime number.<ref name=oeis/>

A Mersenne number <math>2^n-1</math> has a binary representation consisting of <math>n</math> ones, and is pernicious when <math>n</math> is prime. Every Mersenne prime is a Mersenne number for prime <math>n</math>, and is therefore pernicious. By the Euclid–Euler theorem, the even perfect numbers take the form <math>2^{n-1}(2^n-1)</math> for a Mersenne prime <math>2^n-1</math>; the binary representation of such a number consists of a prime number <math>n</math> of ones, followed by <math>n-1</math> zeros. Therefore, every even perfect number is pernicious.<ref>{{citation|first1=Simon|last1=Colton|first2=Louise|last2=Dennis|title=Seventh International Symposium on Artificial Intelligence and Mathematics|contribution=The NumbersWithNames Program|year=2002|contribution-url=https://nottingham-repository.worktribe.com/output/1022768}}</ref><ref>{{citation|first=Tianxin|last=Cai|author-link=Tianxin Cai|title=Perfect Numbers And Fibonacci Sequences|page=50|publisher=World Scientific|year=2022|isbn=978-9811244094}}</ref>

==Related numbers== * Odious numbers are numbers with an odd number of 1s in their binary expansion ({{OEIS2C|id=A000069}}). * Evil numbers are numbers with an even number of 1s in their binary expansion ({{OEIS2C|id=A001969}}).

==References== {{reflist}}

{{Classes of natural numbers |state=collapsed}} Category:Base-dependent integer sequences