# Power of two

In mathematics, a**power of two**is any of the nonnegative integer powers of the number two; in other words, two times itself a certain number of times. Note that one is a power (the zeroth power) of two. Written in binary, a power of two always has the form 10000...0, just like a power of ten in the decimal system.

Because two is the base of the binary system, powers of two are important to computer science. Specifically, two to the power of *n* is the number of ways the bits in a binary integer of length *n* can be arranged, and thus numbers that are one less than a power of two denote the upper bounds of integers in binary computers (one less because 0, not 1, is used as the lower bound). As a consequence, numbers of this form show up frequently in computer software. As one example, in the video game The Legend of Zelda for the 8-bit Nintendo, one can only hold 255 rupeess at one time - the result of a byte, which is 8 bits long, being used to store the number, giving a maximum value of 2^{8}-1 = 255.

Powers of two also measure computer memory. A byte is eight (2^{3}) bits, and a kilobyte (some prefer the word kibibyte) is 1,024 (2^{10}) bytes. Nearly all processor registers have sizes that are powers of two (32 being currently used in most personal computers).

Powers of two occur in a range of other places as well. For many disk drives, at least one of the sector size, number of sectors per track, and number of tracks per surface is a power of two. The logical block size is almost always a power of two.

Numbers which are not powers of two occur in a number of situations such as video resolutions, but they are often the sum or product of only two or three powers of two, or powers of two minus one. For example, 640 = 512 + 128, and 480 = 32 × 15. Put another way, they have fairly regular bit patterns.

A prime number that is one less than a power of two is called a Mersenne prime. For example, the prime number 31 is a Mersenne prime because it is 1 less than 32 (2^{5}).

## The first few powers of two

2^{0} = 1 |
2^{8} = 256 |
2^{16} = 65,536 |

2^{1} = 2 |
2^{9} = 512 |
2^{17} = 131,072 |

2^{2} = 4 |
2^{10} = 1,024 |
2^{18} = 262,144 |

2^{3} = 8 |
2^{11} = 2,048 |
2^{19} = 524,288 |

2^{4} = 16 |
2^{12} = 4,096 |
2^{20} = 1,048,576 |

2^{5} = 32 |
2^{13} = 8,192 |
... |

2^{6} = 64 |
2^{14} = 16,384 |
2^{30} = 1,073,741,824 |

2^{7} = 128 |
2^{15} = 32,768 |
2^{40} = 1,099,511,627,776 |

## Powers of two whose exponents are powers of two

2^{1} = 2 | 2^{16} = 65536 |

2^{2} = 4 | 2^{32} = 4294967296 |

2^{4} = 16 | 2^{64} = 18446744073709551616 |

2^{8} = 256 | 2^{128} = 340282366920938463463374607431768211456 |

## Other recognizable powers of two

- 2
^{24}= 16,777,216 - the number of unique colors that can be displayed in truecolor, which is used by common computer monitors. This number is the result of using the three-channel RGB system, with 8 bits for each channel, or 24 bits in total.