On Tue, Jun 08, 1999 at 11:53:30AM +0200, Alex Kruppa wrote:
>The math is really quite simple: a number n has log_10(n) (logarithm with base 10)
>decimal digits or ld(n) (ld = log_2 = logarithm with base 2) bits.
>You can do a base conversion between logarithms from base a to base b by
>dividing log_a(n) by log_a(b). The log_10(2)  =~  0,301  =~  1 / 3.3219.
>So if you want to know the number of bits in a 10,000,000 digit number,
>you do 10,000,000 / log_10(2) =~ 10,000,000 * 3,3219 = 33,219,000.

Looks like I shouldn't have asked this question, I'm getting flooded
with replies here :-) The exact formula (as Brian pointed out) is:

ceil((x-1)/log10(2))

Set x=10000000, and you get an exponent of 33,219,278 (at least that's
what gcc and my assembly program tells me, Brian found it to be 33,219,277).

>The first prime exponent Mersenne with 10,000,000 digits is M33219281.

And below M36000000, there are 159,975 exponents (again repeating Brian)
with at least 10 million digits.

/* Steinar */
________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm

Reply via email to