Log in
Enquire now
Power of two

Power of two

A power of two is a number of the form 2n where n is an integer, that is, the result of exponentiation with number two as the base and integer n as the exponent.

OverviewStructured DataIssuesContributors

Contents

Other attributes

Wikidata ID
Q19241969

A power of two is a number of the form 2n where n is an integer, that is, the result of exponentiation with number two as the base and integer n as the exponent.

In a context where only integers are considered, n is restricted to non-negative values, so we have 1, 2, and 2 multiplied by itself a certain number of times.

Because two is the base of the binary numeral system, powers of two are common in computer science. Written in binary, a power of two always has the form 100...000 or 0.00...001, just like a power of 10 in the decimal system

Computer science

Two to the power of n, written as 2n, is the number of ways the bits in a binary word of length n can be arranged. A word, interpreted as an unsigned integer, can represent values from 0 (000...0002) to 2n − 1 (111...1112) inclusively. Corresponding signed integer values can be positive, negative and zero; see signed number representations. Either way, one less than a power of two is often the upper bound of an integer in binary computers. As a consequence, numbers of this form show up frequently in computer software. As an example, a video game running on an 8-bit system might limit the score or the number of items the player can hold to 255—the result of using a byte, which is 8 bits long, to store the number, giving a maximum value of 28 − 1 = 255. For example, in the original Legend of Zelda the main character was limited to carrying 255 rupees (the currency of the game) at any given time, and the video game Pac-Man famously has a kill screen at level 256.

Powers of two are often used to measure computer memory. A byte is now considered eight bits (an octet), resulting in the possibility of 256 values (28). (The term byte once meant (and in some cases, still means) a collection of bits, typically of 5 to 32 bits, rather than only an 8-bit unit.) The prefix kilo, in conjunction with byte, may be, and has traditionally been, used, to mean 1,024 (210). However, in general, the term kilo has been used in the International System of Units to mean 1,000 (103). Binary prefixes have been standardized, such as kibi (Ki) meaning 1,024. Nearly all processor registers have sizes that are powers of two, 32 or 64 being very common.

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 that 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 = 32 × 20, and 480 = 32 × 15. Put another way, they have fairly regular bit patterns.

Mersenne and Fermat primes

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 (25). Similarly, a prime number (like 257) that is one more than a positive power of two is called a Fermat prime—the exponent itself is a power of two. A fraction that has a power of two as its denominator is called a dyadic rational. The numbers that can be represented as sums of consecutive positive integers are called polite numbers; they are exactly the numbers that are not powers of two.

Euclid's Elements, Book IX

The geometric progression 1, 2, 4, 8, 16, 32, ... (or, in the binary numeral system, 1, 10, 100, 1000, 10000, 100000, ... ) is important in number theory. Book IX, Proposition 36 of Elements proves that if the sum of the first n terms of this progression is a prime number (and thus is a Mersenne prime as mentioned above), then this sum times the nth term is a perfect number. For example, the sum of the first 5 terms of the series 1 + 2 + 4 + 8 + 16 = 31, which is a prime number. The sum 31 multiplied by 16 (the 5th term in the series) equals 496, which is a perfect number.

As each increase in dimension doubles the number of shapes, the sum of coefficients on each row of Pascal's triangle is a power of two

As each increase in dimension doubles the number of shapes, the sum of coefficients on each row of Pascal's triangle is a power of two

Book IX, Proposition 35, proves that in a geometric series if the first term is subtracted from the second and last term in the sequence, then as the excess of the second is to the first—so is the excess of the last to all those before it. (This is a restatement of our formula for geometric series from above.) Applying this to the geometric progression 31, 62, 124, 248, 496 (which results from 1, 2, 4, 8, 16 by multiplying all terms by 31), we see that 62 minus 31 is to 31 as 496 minus 31 is to the sum of 31, 62, 124, 248. Therefore, the numbers 1, 2, 4, 8, 16, 31, 62, 124 and 248 add up to 496 and further these are all the numbers that divide 496. For suppose that p divides 496 and it is not amongst these numbers. Assume p q is equal to 16 × 31, or 31 is to q as p is to 16. Now p cannot divide 16 or it would be amongst the numbers 1, 2, 4, 8 or 16. Therefore, 31 cannot divide q. And since 31 does not divide q and q measures 496, the fundamental theorem of arithmetic implies that q must divide 16 and be amongst the numbers 1, 2, 4, 8 or 16. Let q be 4, then p must be 124, which is impossible since by hypothesis p is not amongst the numbers 1, 2, 4, 8, 16, 31, 62, 124 or 248.

Selected powers of two

2^8 = 256

The number of values represented by the 8 bits in a byte, more specifically termed as an octet. (The term byte is often defined as a collection of bits rather than the strict definition of an 8-bit quantity, as demonstrated by the term kilobyte.)

2^10 = 1,024

The binary approximation of the kilo-, or 1,000 multiplier, which causes a change of prefix. For example: 1,024 bytes = 1 kilobyte (or kibibyte).

2^12 = 4,096

The hardware page size of an Intel x86-compatible processor.

2^15 = 32,768

The number of non-negative values for a signed 16-bit integer.

2^16 = 65,536

The number of distinct values representable in a single word on a 16-bit processor, such as the original x86 processors

The maximum range of a short integer variable in the C#, and Java programming languages. The maximum range of a Word or Smallint variable in the Pascal programming language.

The number of binary relations on a 4-element set.

2^20 = 1,048,576

The binary approximation of the mega-, or 1,000,000 multiplier, which causes a change of prefix. For example: 1,048,576 bytes = 1 megabyte (or mebibyte).

224 = 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.

The size of the largest unsigned integer or address in computers with 24-bit registers or data buses.

2^29 = 536,870,912

The largest power of two with distinct digits in base ten.[5]

230 = 1,073,741,824

The binary approximation of the giga-, or 1,000,000,000 multiplier, which causes a change of prefix. For example, 1,073,741,824 bytes = 1 gigabyte (or gibibyte).

2^31 = 2,147,483,648

The number of non-negative values for a signed 32-bit integer. Since Unix time is measured in seconds since January 1, 1970, it will run out at 2,147,483,647 seconds or 03:14:07 UTC on Tuesday, 19 January 2038 on 32-bit computers running Unix, a problem known as the year 2038 problem.

2^32 = 4,294,967,296

The number of distinct values representable in a single word on a 32-bit processor. Or, the number of values representable in a doubleword on a 16-bit processor, such as the original x86 processors

The range of an int variable in the Java and C# programming languages.

The range of a Cardinal or Integer variable in the Pascal programming language.

The minimum range of a long integer variable in the C and C++ programming languages.

The total number of IP addresses under IPv4. Although this is a seemingly large number, IPv4 address exhaustion is imminent.

The number of binary operations with domain equal to any 4-element set, such as GF(4).

2^40 = 1,099,511,627,776

The binary approximation of the tera-, or 1,000,000,000,000 multiplier, which causes a change of prefix. For example, 1,099,511,627,776 bytes = 1 terabyte (or tebibyte).

2^50 = 1,125,899,906,842,624

The binary approximation of the peta-, or 1,000,000,000,000,000 multiplier. 1,125,899,906,842,624 bytes = 1 petabyte (or pebibyte).

2^53 = 9,007,199,254,740,992

The number until which all integer values can exactly be represented in IEEE double precision floating-point format. Also the first power of 2 to start with the digit 9 in decimal.

2^56 = 72,057,594,037,927,936

The number of different possible keys in the obsolete 56 bit DES symmetric cipher.

2^60 = 1,152,921,504,606,846,976

The binary approximation of the exa-, or 1,000,000,000,000,000,000 multiplier. 1,152,921,504,606,846,976 bytes = 1 exabyte (or exbibyte).

2^63 = 9,223,372,036,854,775,808

The number of non-negative values for a signed 64-bit integer.

2^64 = 18,446,744,073,709,551,616

The number of distinct values representable in a single word on a 64-bit processor. Or, the number of values representable in a doubleword on a 32-bit processor. Or, the number of values representable in a quadword on a 16-bit processor, such as the original x86 processors.

The range of a long variable in the Java and C# programming languages.

The range of a Int64 or QWord variable in the Pascal programming language.

The total number of IPv6 addresses generally given to a single LAN or subnet.

One more than the number of grains of rice on a chessboard, according to the old story, where the first square contains one grain of rice and each succeeding square twice as many as the previous square. For this reason the number 2^64 − 1 is known as the "chess number".

2^64 − 1 is also the number of moves required to complete the legendary 64-disk version of the Tower of Hanoi.

2^68 = 295,147,905,179,352,825,856

The first power of 2 to contain all decimal digits. (sequence A137214 in the OEIS)

2^70 = 1,180,591,620,717,411,303,424

The binary approximation of the zetta-, or 1,000,000,000,000,000,000,000 multiplier. 1,180,591,620,717,411,303,424 bytes = 1 zettabyte (or zebibyte).

2^80 = 1,208,925,819,614,629,174,706,176

The binary approximation of the yotta-, or 1,000,000,000,000,000,000,000,000 multiplier. 1,208,925,819,614,629,174,706,176 bytes = 1 yottabyte (or yobibyte).

2^86 = 77,371,252,455,336,267,181,195,264

2^86 is conjectured to be the largest power of two not containing a zero in decimal.[7]

2^96 = 79,228,162,514,264,337,593,543,950,336

The total number of IPv6 addresses generally given to a local Internet registry. In CIDR notation, ISPs are given a /32, which means that 128-32=96 bits are available for addresses (as opposed to network designation). Thus, 296 addresses.

2^108 = 324,518,553,658,426,726,783,156,020,576,256

The largest known power of 2 not containing a 9 in decimal. (sequence A035064 in the OEIS)

2^126 = 85,070,591,730,234,615,865,843,651,857,942,052,864

The largest known power of 2 not containing a pair of consecutive equal digits. (sequence A050723 in the OEIS)

2^128 = 340,282,366,920,938,463,463,374,607,431,768,211,456

The total number of IP addresses available under IPv6. Also the number of distinct universally unique identifiers (UUIDs).

2^168 = 374,144,419,156,711,147,060,143,317,175,368,453,031,918,731,001,856

The largest known power of 2 not containing all decimal digits (the digit 2 is missing in this case). (sequence A137214 in the OEIS)

2^192 = 6,277,101,735,386,680,763,835,789,423,207,666,416,102,355,444,464,034,512,896

The total number of different possible keys in the AES 192-bit key space (symmetric cipher).

2^229 = 862,718,293,348,820,473,429,344,482,784,628,181,556,388,621,521,298,319,395,315,527,974,912

2^229 is the largest known power of two containing the least number of zeros relative to its power. It is conjectured by Metin Sariyar that every digit 0 to 9 is inclined to appear an equal number of times in the decimal expansion of power of two as the power increases. (sequence A330024 in the OEIS)

2^256 = 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

The total number of different possible keys in the AES 256-bit key space (symmetric cipher).

2^333 = 17,498,005,798,264,095,394,980,017,816,940,970,922,825,355,447,145,699,491,406,164,851,279,623,993,595,007,385,788,105,416,184,430,592

The smallest power of 2 greater than a googol (10100).

2^1024 = 179,769,313,486,231,590,772,931,...,304,835,356,329,624,224,137,216

The maximum number that can fit in an IEEE double-precision floating-point format, and hence the maximum number that can be represented by many programs, for example Microsoft Excel.

282,589,933 = 148,894,445,742,041,...,210,325,217,902,592

One more than the largest known prime number as of December 2018. It has more than 24 million digits

Timeline

No Timeline data yet.

Further Resources

Title
Author
Link
Type
Date

Mathematics masterclasses : stretching the imagination : Free Download, Borrow, and Streaming : Internet Archive

https://archive.org/details/mathematicsmaste0000unse/page/78

Web

1997

O potęgach dwójki

http://www.deltami.edu.pl/temat/matematyka/teoria_liczb/2011/03/07/O_potegach_dwojki/

Web

March 7, 2011

Prime Curios! 536870912

https://primes.utm.edu/curios/page.php/536870912.html

Web

Prime Curios! 536870912

https://primes.utm.edu/curios/page.php/536870912.html

Web

Unsolved Problems in Number Theory

https://books.google.com/books?id=1AP2CEGxTkgC&pg=PA346

Web

References

Find more entities like Power of two

Use the Golden Query Tool to find similar entities by any field in the Knowledge Graph, including industry, location, and more.
Open Query Tool
Access by API
Golden Query Tool
Golden logo

Company

  • Home
  • Press & Media
  • Blog
  • Careers
  • WE'RE HIRING

Products

  • Knowledge Graph
  • Query Tool
  • Data Requests
  • Knowledge Storage
  • API
  • Pricing
  • Enterprise
  • ChatGPT Plugin

Legal

  • Terms of Service
  • Enterprise Terms of Service
  • Privacy Policy

Help

  • Help center
  • API Documentation
  • Contact Us
By using this site, you agree to our Terms of Service.