# How many digits are in the integer representation of 2 to the 30th power?

How many digits are in the integer representation of 2 to the 30th power?

Since I didn't really know any 'expert' way to approach this, I just started out by listing the powers of 2, like 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 etc. and the same sequence looking only at the digits would be 1, 1, 1, 2, 2, 2, 3, 3, 3, 4 etc. At first it'd seem like the pattern is 3 numbers for each digit (if you understand what I mean), but from 1024 onwards, the pattern breaks, with there being 4 four-digit numbers, 3 five-digit numbers, 3 six-digit numbers and et cetera.

So I couldn't find a pattern, and now I'm stuck, but I think there might actually be an easier way to solve this, or maybe a formula.

• $$1 + \left\lfloor30\log_{10} (2)\right\rfloor$$ – Zubin Mukerjee Mar 11 '16 at 14:42

For the first few hundred powers of two, it's roughly true that $10^{3k} \approx 2^{10k}$

Specifically, if $k=3$, that gives that $2^{30}$ is a little over a billion, which means it has $\boxed{10}$ digits.

A general formula for the number of digits of any power of $2$ can be found using the value of the base-$10$ logarithm of $2$. The number of digits in $2^k$ is

$$1 + \left\lfloor k\log_{10}(2)\right\rfloor$$

Since $$10^3 < 2^{10} < 2 \cdot 10^{3}$$

You have $$10^9 < 2^{30} < 8 \cdot 10^{9} <10^{10}$$

You could convert a power of 2 to a power of 10 in the following way, yielding you an exponent which can be used easily to find the number of digits.

$2^{30}=(2^{\log_210})^\frac{30}{\log_210} = 10^\frac{30}{\log_210} \approx 10^{9.031}$

$10^9 < 10^{9.031} < 10^{10} \implies$ there are 10 digits in $2^{30}$

You're really asking for the log, base $10$, of $2^{30}$. Now, everybody should remember that $\log_{10}2=.30103\dots$. So the log of $2^{30}$ is about $9.03$, telling you that there are ten digits.

You could figure this out quite easily writing say, $32 = 2^5$ in scientific notation and raising to the 6th power.

Knowing that a kilobyte is $1024$ bytes, which is also a power of $2$, namely $2^{10}$, you can infer that $2^{30}$ is a gigabyte, a little more than a billion bytes, hence $9$ digits.