On Thu, Jun 16, 2005 at 10:47:32AM +0100, Douglas K Chester NONLILLY wrote:
> 
> I have just been given an exponent to test for GIMPS - it is 34642837. How 
> do I work out how many digits it has please? I've looked at some of 
> Mersenne primes listed and divided the exponent by the number of digits 
> and always seem to get around 3.32192807. Dividing my expoent by this 
> gives, to the nearest whole number, 10428533 (or, dividing some other 
> exponents by numbers of digits, 10428534 or 10428535). Does this mean 
> 2^{34642837} has 10428533 digits please?

Almost.

Logarithms are your friend.  Since log(x^y) = y log(x), then 
log10(2^n) = n log10(2)

log10(2) = 0.30103   (which is 1/3.2321928)

Now, for integer m, 10^m will have m+1 digits (e.g. log10(10) = 1).

So the number of digits in 2^n will be the integer part of (1 + n log10(2)).
In this case, 10428534.

You're actually considering (2^n)-1, but this will have the same number
of digits as 2^n for all positive integer n :-)

-- 
--------------- Robin Stevens  <[EMAIL PROTECTED]> -----------------
Oxford University Computing Services ----------- Web: http://www.cynic.org.uk/
------- (+44)(0)1865: 273212 (work) 273275 (fax)  Mobile: 07776 235326 -------
_______________________________________________
Prime mailing list
[email protected]
http://hogranch.com/mailman/listinfo/prime

Reply via email to