How can find the numbers of digits of power numbers

420 Views Asked by At

let $a$ and $n$ are natural numbers and $A=a^n$. Then how we can find the numbers of digits of $a^n$.

For example $A= 2^{101}$. Then we $2^{10}=1024\cong=1000=10^3$. So $2^{101}=2\times (2^{10})^{10}\cong2\times (10^3)^{10}=2\times 10^{30}$. so $2^{101}$ has almost 31 digits.

But what is the exact numbers of digits of $2^{101}$?

2

There are 2 best solutions below

0
On BEST ANSWER

A number $a$ has $n$ digits if and only if $$10^{n-1} \leq a <10^n$$

This is equivalent to $$n-1 \leq \log_{10} (a) < n$$

or $$n= 1+ \lfloor \log_{10}(a) \rfloor$$ where $\lfloor . \rfloor$ denotes the integer part.

In your example $$\log_{10}2^{101} =101 \cdot \log_{10}(2)$$

Now use a logarithmic table to find $\log_{10}(2)$.

2
On

The number of digits of $n$ is $ceil(log_{10}(n))$ , where ceil means rounding up unless $n$ happens to be a power of $10$, lets say $10^k$. In this case, the number of digits is $k+1$. Here we have $ceil(101\times log_{10}(2)=31$

To avoid the issue with the case of a power of ten, you can also use $number\ of\ digits\ of\ n = trunc(log_{10}(n)+1)$ , where trunc means canceling the fractional part. This formula is correct for every positive integer.

Note that a calculator might falsely round an integer , as the following PARI-program shows :

? truncate(log(1000)/log(10)+1)
%132 = 3
? #digits(1000)
%133 = 4
? log(1000)/log(10)+1
%134 = 4.000000000000000000000000000
?

If the number is very large and only a bit larger than a power of $10$, you could also have troubles if the precision is not high enough. But for most of the numbers the formula works well and the calculation can be made even with a table calculator.