# How to calculate the digits of a huge number?

Example, 2^2014 has 607. How many digits in 5^2014?

Is there any relation between the two numbers? I found the answer to be 1009 because there exists a pattern in the repeating digits.

-
$5^{2014}$ has $1408$ digits. –  TonyK Apr 9 at 23:27
Could you post ur answer and works? –  user11355 Apr 9 at 23:35
You first.${}{}$ –  TonyK Apr 9 at 23:36

$2^n \cdot 5^n = 10^n$, which has $n+1$ digits. When we multiply there will be a carry. So if $2^n$ has $m$ digits, $5^n$ has $n-m+1$ digits.Alpha shows it has $1408$ digits

-
Now that's clever. I like it (+1)! –  MPW Apr 9 at 23:20
Why is this? It sure works, why? –  user11355 Apr 9 at 23:27
It's not quite right, as you can see by trying $n=1$ or $2$. In fact $5^n$ has $n-m+1$ digits. (You seem to have assumed that $m$ digits multiplied by $k$ digits has $m+k$ or $m+k+1$ digits, whereas in fact it has $m+k-1$ or $m+k$ digits.) –  TonyK Apr 9 at 23:33
@TonyK: You are correct, thanks. –  Ross Millikan Apr 9 at 23:37
@user139024: Fleshing out what TonyK says, if $a$ has $m$ digits and $b$ has $k$ digits, we have $10^{m-1}\le a \lt 10^m$ and $10^{k-1} \le b \lt 10^k$, so $10^{m+k-2} \le ab \lt 10^{m+k}$. The fact that we have a carry says $10^{m+k-1}$ is the power of interest. –  Ross Millikan Apr 9 at 23:40

You can take the base 10 logarithm, and round up. $\log_{10}{5^{2014}} = 2014\log_{10}{5}$. How useful this is depends on whether you can compute the logarithm of 5.

-

The number of digits in $a^b$ is surely the least integer greater than or equal to $b\log_{10}a$, right?

-

Hint:

if $m$ is the number of digits of a number $x$ then we have: $$10^{m-1} \leq x < 10^m$$ because $10^k$ is the smallets number having $k$ digits.

We deduce: $$m-1 \leq \log(x)< m$$ where $\log$ is the decimal logarithm.

Thus:$$m \leq 1+\log(x) < m+1$$ who gives: $$m=[1+\log(x)]$$ where $[y]$ is the integer part of $y$ that is the bigest integer $k$ such that $k \leq y$, that is the unique integer $k$ such that $k \leq y < k+1$)

-