0

Is there any easy way to find out how many digits does the number $12^{400}$ have or such types of problems like how many digits the number $x^y$ have? ($x$ and $y$ are variables)

JMoravitz
  • 79,518

2 Answers2

2

If $x$ and $y$ aren’t too awfully large, you can simply calculate $\log_{10}x^y=y\log_{10}x$. For example,

$$\log_{10}12^{400}=400\log_{10}12\approx431.6725\;,$$

which tells you that the number has $431+1=432$ digits in base ten.

Brian M. Scott
  • 616,228
1

In general, you can calculate the number of digits in an arbitrary base $n$ of an expression $a^b$ by the formula $$D = \lfloor 1 + \log_{n}(a^b)\rfloor = \lfloor 1 + (b)\log_{n}(a)\rfloor$$ where $D$ represents the number of digits in your result.

Owain West
  • 287
  • 2
  • 11
  • can you please tell me the detailed process of deduction of D? @Owain West – user355702 Jul 22 '16 at 20:13
  • @user355702 $D$ represents the number of (base $n$ - in your case, the base is 10 since you're talking about decimal numbers) digits in the number. The $\log_n$ of a number can be viewed as a function mapping any number to the a real that is close to the number of digits that it takes to express that number in base $n$. The adding 1 and floor convert the result of the $\log_n$, which is a real number, into the integer which represents the actual number of digits. – Owain West Jul 22 '16 at 20:21
  • @user355702 $\log_{10}(12345)=4.09149$ because $10^{4.019149}=12345$. Furthermore, since $\log_{10}(12345)=4.09$, rounding up gives us $4.09\to5$, which means $12345$ has $5$ digits. For the case $x^y$, we can just use $y\times\log_{10}(x)$ and round up to find the number of digits. – Simply Beautiful Art Jul 22 '16 at 21:31