wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> easy >> How many digits?
(Message started by: BNC on Jun 3rd, 2004, 5:37am)

Title: How many digits?
Post by BNC on Jun 3rd, 2004, 5:37am
If I were to write the number 22004 followed by the number 52004 (both in explicit decimal notation), how many digits would I write?

Title: Re: How many digits?
Post by Grimbal on Jun 3rd, 2004, 6:22am
Ten.  But some of them more than once.  ;D

More seriously, I would propose: [hide]ceil(log10(2)*2004)+ceil(log10(5)*2004) which I leave to the reader to calculate.[/hide]

Title: Re: How many digits?
Post by harpanet on Jun 3rd, 2004, 6:42am
I'll do the calculation by hand and let you know next year.

Title: Re: How many digits?
Post by BNC on Jun 3rd, 2004, 7:08am

on 06/03/04 at 06:22:57, Grimbal wrote:
... I would propose: <hidden>


explaining how you arrived at an answer is more valuable than the answer itself !

Title: Re: How many digits?
Post by Grimbal on Jun 3rd, 2004, 7:53am

on 06/03/04 at 07:08:03, BNC wrote:
explaining how you arrived at an answer is more valuable than the answer itself !


I didn't give the answer, I just told how I computed it!

OK.  A N-number digit can have values 10^(N-1)<=value<10^N.
so, (N-1)<=log10(value)<N which means that if you know the value and want to know the number of digits, you have N=floor(log10(value))+1.  (I used ceil because in this case, the logs are not integers)
If for example value = 3^123, log10(value) = 123*log10(3).
This is valid for all 3 in {2,5} and any 123 in {2004}.

But I realised there is a much simpler way to get to the same result.

Title: Re: How many digits?
Post by towr on Jun 3rd, 2004, 8:30am
::[hide]log10(2) + log10(5) = 1, so I get 2005
Because ceil(a+b) <= ceil(a) + ceil(b) <= ceil(a+b) + 1, and in this case a+b is an integer and a and b aren't.[/hide]::

Title: Re: How many digits?
Post by Grimbal on Jun 3rd, 2004, 8:39am
Exactly.  Since 2*5=10.
::[hide]You have 2 numbers of which the product is 10^2024.  It must have 2005 digits, since they are not of the form 10^n.[/hide]::



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board