Odious number

Number with odd number of 1s in binary

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.

In number theory, an odious number is a positive integer that has an odd number of 1s in its binary expansion. Non-negative integers that are not odious are called evil numbers.

In computer science, an odious number is said to have odd parity.

Examples

The first odious numbers are:

1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 21, 22, 25, 26, 28, 31, 32, 35, 37, 38 ... [1]

Properties

If a ( n ) {\displaystyle a(n)} denotes the n {\displaystyle n} th odious number (with a ( 0 ) = 1 {\displaystyle a(0)=1} ), then for all n {\displaystyle n} , a ( a ( n ) ) = 2 a ( n ) {\displaystyle a(a(n))=2a(n)} .[2]

Every positive integer n {\displaystyle n} has an odious multiple that is at most n ( n + 4 ) {\displaystyle n(n+4)} . The numbers for which this bound is tight are exactly the Mersenne numbers with even exponents, the numbers of the form n = 2 2 r 1 {\displaystyle n=2^{2r}-1} , such as 3, 15, 63, etc. For these numbers, the smallest odious multiple is exactly n ( n + 4 ) = 2 4 r + 2 2 r + 1 3 {\displaystyle n(n+4)=2^{4r}+2^{2r+1}-3} .[3]

Related sequences

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.[4]

References

  1. ^ Sloane, N. J. A. (ed.), "Sequence A000069 (Odious numbers: numbers with an odd number of 1's in their binary expansion)", The On-Line Encyclopedia of Integer Sequences, OEIS Foundation
  2. ^ Allouche, J.-P.; Cloitre, Benoit; Shevelev, V. (2016), "Beyond odious and evil", Aequationes Mathematicae, 90 (2): 341–353, doi:10.1007/s00010-015-0345-3, MR 3480513, S2CID 253596104
  3. ^ Morgenbesser, Johannes F.; Shallit, Jeffrey; Stoll, Thomas (2011), "Thue–Morse at multiples of an integer", Journal of Number Theory, 131 (8): 1498–1512, arXiv:1009.5357, doi:10.1016/j.jnt.2011.02.006, MR 2793891, S2CID 119309022
  4. ^ Lambek, J.; Moser, L. (1959), "On some two way classifications of integers", Canadian Mathematical Bulletin, 2 (2): 85–89, doi:10.4153/CMB-1959-013-x, MR 0104631

External links

  • v
  • t
  • e
Classes of natural numbers
Of the form a × 2b ± 1
Other polynomial numbers
Recursively defined numbers
Possessing a specific set of other numbers
Expressible via specific sums
2-dimensional
centered
non-centered
3-dimensional
centered
non-centered
pyramidal
4-dimensional
non-centered
Combinatorial numbers
Divisor functions
Prime omega functions
Euler's totient function
Aliquot sequences
Primorial
Numeral system-dependent numbers
Arithmetic functions
and dynamics
Digit sum
Digit product
Coding-related
Other
P-adic numbers-related
Digit-composition related
Digit-permutation related
Divisor-related
Other
Generated via a sieve
  • Mathematics portal