# Why is -1 needed to get 65,535 from a 2^16 binary power calculation?

It was stated in the Wikipedia article 65,535:

65535 occurs frequently in the field of computing because it is

`2^16-1`

(one less than 2 to the 16th power), which is the highest number that can be represented by an unsigned 16-bit binary number.

I didn't understand from this passage why is the `-1`

needed to get the number 65,535 from the power operation.

## 1 answer

The short answer: because 2^{16} = 65536, it follows that 2^{16} - 1 = 65535.

Remember how exponentials work: *i*^{n} is *i* multiplied by itself *n* times (for integer values of *n* ≥ 1).

Therefore, 2^{16} = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2. (2 multiplied by itself 16 times.) Since the only distinct multiplicant is an even number, it follows that the result must also be an even number.

2^{16} is the number of *distinct values* that can be represented with exactly 16 symbols each taking one of two values (in this case, traditionally 0 and 1). The more general form is *m*^{n} where *m* is the size of the symbol set, and *n* is the number of symbols being used. The latter is why, for example, 2^{16} = 16^{4} (you can use 16 binary digits, or 4 hexadecimal digits, to represent the same value range).

When you include being able to represent the number 0, which is often useful and the lack of which would require some kind of special handling, the maximum number possible to represent within 2^{16} distinct values is 2^{16} - 1; you need to subtract 1 because the value 0 is one ("1") possible value.

## 0 comments