Parity (mathematics)

In mathematics, parity is the property of an integer of whether it is even or odd. An integer is even if it is divisible by 2, and odd if it is not. For example, −4, 0, and 82 are even numbers, while −3, 5, and 23 are odd numbers.

The above definition of parity applies only to integer numbers, hence it cannot be applied to numbers with fractions or decimals such as 12 or 4.6978. See § Higher mathematics for some extensions of the notion of parity to a larger class of "numbers" or in other more general settings.

Even and odd numbers have opposite parities, for example 22 (an even number) and 13 (an odd number). In particular, the parity of zero is even. Any two consecutive integers have opposite parity. An integer expressed in the decimal numeral system is even or odd according to whether its last digit is even or odd. That is, if the last digit is 1, 3, 5, 7, or 9, then it is odd; otherwise it is even—as the last digit of any even number is 0, 2, 4, 6, or 8.

This concept applies to any even base system: any integer expressed in the binary numeral system is odd if its last digit is 1; and it is even if its last digit is 0. In an odd base, the number is even if and only if the sum of its digits is even; for example, in base seven, 11 (equivalent to 8 in base ten) is even (because ) and 115 (equivalent to 61 in base ten) is odd (because ).