# How to calculate number of digits of a large number?

Does anyone know any efficient ways of finding the number of digits in the large number $N = 4^{4^{4^4}}$? Thanks.

-
The number of digits of a natural number $N$ expressed in base $10$ is $\lfloor\log_{10}(N)\rfloor+1$. I am not sure how one would go about computing this in an effective way. – Michael Albanese Jan 8 '13 at 11:39

This is a really interesting topic! I googled around a bit and discovered a question which somebody else asked, which looks similar to yours. And below it is an excellent answer. Finding the number of digits of a large number.

I hope this helps.

Seraphina

-

An approximation: $4^{4^4} = 4^{256}$ is approximately $1.34078079 \times 10^{154}$

So the number of digits in $4^{4^{4^4}}$ is approximately $\log_{10}4\times1.34078079 \times 10^{154}$ which is about $8.0723047\times10^{153}$.

It would not be too arduous to (get a computer to) perform this calculation exactly.

Update
The number of digits required is $\lfloor 4^{256}\times \log_{10}4 \rfloor + 1 = \lfloor 2^{513}\times \log_{10}2 \rfloor + 1$. If $\log_{10}2$ is calculated in binary, the multiplication by $2^{513}$ is just a matter of shifting bits, and the problem is reduced to calculating $\log_{10}2$ with the necessary accuracy, which admittedly is not simple.
For completeness, here is the entire WolframAlpha calculation.

-
See mr. FS's answer below. One of you is really off track.. – nbubis Jan 8 '13 at 12:16
@nbubis: see my comment under mr.FS's answer. – Peter Phipps Jan 8 '13 at 12:18
I'm sorry about that, you are right. This is because exponentiation is right-associative, right? – user50407 Jan 8 '13 at 12:30
Are you suggesting that it would not be too arduous to express $4^{4^{4^4}}$ explicitly in base 10? If not, what are you proposing? – TonyK Jan 8 '13 at 14:26
@TonyK, I'm saying that it wouldn't be too hard to perform the full $\log_{10}4×1.34078079×10^{154}$ calculation, but accurately. – Peter Phipps Jan 8 '13 at 14:57

The exact number of digits is

? ceil(4^4^4*log(4)/log(10))
%39 = 80723047260282253793826303970853990300713679217387430318670828284184144815
68309149198911814701229483451981557574771156496457238535299087481244990261351117


The number of digits has itself $154$ digits.

-