Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Two numbers $2^k$ and $5^p$ are expanded first then written side by side i.e. adjacent to each other. Find the total number of digits in that case if $k = p = 2004$.

My approach :

$2004\times \log 5 = 1400 $
so number of digits would be $1401$.
$2004 \times log 2 + 1 = 604$
Total digits $= 2005$

share|improve this question
    
what is the expansion base here? –  Aang Jun 27 '12 at 6:45
2  
Decimal, apparently. OP you should be more explicit with your roundings. –  anon Jun 27 '12 at 6:50
    
The log which I have taken here is with base 10. –  Bazinga Jun 27 '12 at 6:53
    
Then,I think your result is fine. –  Aang Jun 27 '12 at 6:56
    
More precisely $2004 \times \log 5 = 1400.7\ldots$ and $2004 \times \log 2 = 603.26\ldots$ but apart from that you are correct –  Henry Jun 27 '12 at 7:15

2 Answers 2

up vote 2 down vote accepted

If you are working in base 10 you have the number of digits of $x$ as $\lfloor \log_{10} x\rfloor+1$. Assume logs are to base 10 to simplify notation.

The number of digits you need is then, as you calculate:

$\lfloor \log {2^p}\rfloor+1+\lfloor \log {5^p}\rfloor+1 = \lfloor p\log {2}\rfloor+1+\lfloor p\log {5}\rfloor+1$

Aside from the fact that you might have a rounding error of 1, you can then use $p\log2+p\log5=p\log{10}=p$.

So your answer will be $p+2 \text { or } p+1$

Then note, as Henry points out, that the logs are related - the floor function always reduces the total by 1 and never by zero, because the logs are not rational, so the answer is $p+1$

share|improve this answer
    
I don't think "you need to know the logs accurately enough". It will always be $p+1$ for integer $p=k$ –  Henry Jun 27 '12 at 7:11
    
So my approach is correct, sirs? –  Bazinga Jun 27 '12 at 7:12
    
@Henry You are right, of course, because the remainders of the two floor terms are not independent of one another, but sum to 1, and as you noted in your answer, the logs are not rational, so you never get a zero. I will modify accordingly. –  Mark Bennet Jun 27 '12 at 7:16
    
@Bazinga: Yes, your approach works (though there is some rounding) and would work for more general $k$ and $p$ –  Henry Jun 27 '12 at 7:16

Your method works though for integer $k=p \gt 0$ you do not even have to calculate the logarithms.

Since $k \, \log_{10}(5) + k \,\log_{10}(2) = k \, \log_{10}(10) = k$ and the logarithms are not rational numbers, then the number of digits of the concatenated number must be $k+1$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.