At 01:01 AM 10/25/2001 -0500, you wrote:
>Forgive my ignorance but;
>
>In reading the Lucas Wiman Mersenne Prime FAQ I became confused at the Q5.3
>instruction. (see FAQ insert below).
>
>I want to know how many decimal digits are in a given MP.
>This part of the FAQ does not make sense to me.
>
>Specifically;
> 
>First off this question seems to ask 10,000,000 exponents. It must mean
>10,000,000 digits. 
>
>The answer given below, M33219278, by my calculations, has less than
>10,000,000 digits. The questions below ask "How many digits are in a given
>Mp?" and "What is the smallest Mp with a given number of digits?"
>
>The explanation does not seem to answer that question. 
>
>33,219,278/3.321928094887 = 9,999,999.11230167668 and
>
>33,219,279/3.321928094887 = 9,999,999.41333167235 and
>
>33,219,280/3.321928094887 = 9,999,999.71436166801 and
>
>33,219,281/3.321928094887 = 10,000,000.0153916636 
>
>This number 33,219,281 seems, from the explanation below, to be the first
>Mp to have 10,000,000 decimal digits. Can I depend on this? This would seem
>to make the answer 33,219,278 the third highest Mp with less than
>10,000,000 digits.

Mp is shorthand for Mersenne Prime, a number having value one less than
two raised to the power p where p is a prime, often written in ascii, 2^p-1
meaning (2^p) -1 and not 2^(p-1) because exponentiation is an operator of
higher precedence than subtraction.

2^33219278-1 is not a Mersenne Prime since 33219278 is not prime, being even.
The only exponent of the four above that is prime is 33219281.
(33219279 mod 3 = 0 by eye; 33 21 9 27 9)

M33219278 is the smallest Mersenne Number with at least 10^7 digits, but
M33219281 is the smallest Mersenne Prime with at least 10^7 digits.
This distinction is economically important because

>I need a formula that will definitely give the exact number of decimal
>digits in a Mp or Mersenne prime Mp.


At 09:30 AM 10/25/2001 -0500, Tony Pryse <[EMAIL PROTECTED]> wrote:
>Dan,
>
>The FAQ is correct. (The version I saw has "10,000,000 exponents" corrected 
>to "10,000,000 digits", as you note it should.)
>
>The number of digits, d, in a Mersenne number,  2^n-1, is "the least integer 
>greater than or equal to n/log_2(10)." (The number of digits in an integer 
>must itself be an integer.) 

The rule in the FAQ answer misses a case.
Consider some very small exponents:
2^0=1; log10(1)=0; # of digits =1
2^0-1=0; log10(Mn)= -infinity?; # of digits=1; rule yields 0
2^1=2; log10(2)=~.3010; 1 digit
2^2=4; log10(4)=~.6020; 1 digit
2^3=8; log10(8)=~.9030; 1 digit
2^4=16; log10(16)=~1.204; 2 digits
...
2^10=1024; log10(1024)=~3.0103; 4 digits

10^1=10; log10(10)=1; 2 digits
10^3=1000; log10(1000)=3; 4 digits

The number of digits required is always at least one.
The number of digits is rounded up, not down.

I suggest the "or equal" is incorrect.


Ken

_________________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to