Powers of Two

Complete list of powers of 2 up to 1,000,000

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288

What are Powers of Two?

A power of two is a number of the form 2n, where n is a non-negative integer. The sequence begins: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288. Each number is exactly double the previous one.

Powers of Two in Computer Science

Powers of two are the foundation of digital computing. Computers use the binary number system (base 2), where every number is represented using only digits 0 and 1. Each binary digit (bit) represents a power of 2. A byte (8 bits) can store 28 = 256 values (0–255). Standard data types include 16-bit (216 = 65536 values), 32-bit (232 = 4,294,967,296 values), and 64-bit integers.

Memory sizes are measured in powers of two: 1024 bytes = 1 kilobyte (KB), 1024 KB = 1 megabyte (MB), 1024 MB = 1 gigabyte (GB). Common memory sizes like 256 MB, 512 MB, 1024 MB are all powers of two. Screen resolutions, texture sizes, and buffer sizes in graphics programming are typically powers of two for efficient memory alignment.

Mathematical Properties

Every power of two has exactly one 1-bit in its binary representation: 1 = 1, 2 = 10, 4 = 100, 8 = 1000, etc. This property provides the fastest way to test if a number is a power of two: n & (n - 1) == 0 (and n > 0). This bitwise trick is one of the most commonly used in programming.

The sum of all powers of two up to 2n equals 2n+1 − 1. For example, 1 + 2 + 4 + 8 + 16 = 31 = 25 − 1. Numbers of the form 2n − 1 are called Mersenne numbers, and when they are prime, they are Mersenne primes — the largest known primes are Mersenne primes.

Powers of Two in Nature

Cell division follows powers of two: a single cell divides into 2, then 4, 8, 16, 32, and so on. Exponential growth patterns in biology, finance, and physics often involve powers of two or closely related exponential functions. The classic wheat and chessboard problem — placing 1 grain on the first square, 2 on the second, 4 on the third, and so on — results in 264 − 1 = 18,446,744,073,709,551,615 total grains, illustrating the explosive nature of exponential growth.

Famous Powers of Two

256 (28) — the number of values in a byte, and the number of colors in classic 8-bit graphics. 1024 (210) — the basis of binary prefixes (kibi, mebi, gibi). 4096 (212) — common page size in operating systems. 65536 (216) — the number of TCP/UDP ports. 2048 (211) — the name of a popular puzzle game where tiles are merged by doubling.

The Power of Doubling

The doubling time concept is essential in understanding exponential growth. If something grows at a constant percentage rate, it doubles in a fixed time period. This applies to compound interest, bacterial populations, radioactive decay (half-life is the inverse), and Moore's Law (the observation that transistor count doubles approximately every two years). Understanding powers of two is key to grasping exponential phenomena in the real world.