20200229, 11:13  #1 
Feb 2020
France
2 Posts 
What size of Mersenne number ?
Hi forum
i'm noob this is my first post here my pc calculates the exponent 106 949 789 is there a method to know the size of the calculated number? (I think around 13000K) 
20200229, 12:05  #2 
Einyen
Dec 2003
Denmark
6076_{8} Posts 
You can find the number of digits by taking the base 10 logarithm and rounding up:
log_{10}(2^{106949789}) = 106949789* log_{10}(2) = 106949789 * 0.301030 = 32195094.5 So the number is 32,195,095 digits long. Last fiddled with by ATH on 20200229 at 12:09 
20200229, 19:19  #3 
Feb 2020
France
2 Posts 
it's fine
TY 
20210413, 13:46  #4 
"David Kirkby"
Jan 2021
Althorne, Essex, UK
321_{8} Posts 
Could that method be in error by one digit occasionally, as one actually wants the number of digits in 2^n 1, not those in 2^n? I would think one might run into problems with the precision of floating point arithmetic, but probably not for the exponents we are currently testing.

20210413, 14:23  #5 
Jun 2003
2×13×191 Posts 

20210413, 15:15  #6  
Feb 2017
Nowhere
3^{2}·5·101 Posts 
Quote:
One thing you do have to be careful about is that the value of log(2)/log(10) is sufficienty accurate. With an exponent around 10^{8}, you want an error in the log value of significantly less than 10^{8}. Now .301030 doesn't appear to be accurate enough, but looking at the more precise value 0.30102999566398 we see that .301030 is too large, but by less than 0.5 x 10^{8}. 

20210413, 15:59  #7  
"Robert Gerbicz"
Oct 2005
Hungary
3^{2}·163 Posts 
Quote:
Code:
? n=181605302766736484827; ? \p realprecision = 38 significant digits ? ? floor(n*log(2)/log(10)+1) %2 = 54668643504426676183 ? ? default(realprecision,100) ? \p realprecision = 115 significant digits (100 digits displayed) ? ? floor(n*log(2)/log(10)+1) %4 = 54668643504426676182 ? ? ? n*log(2)/log(10)+1 %5 = 54668643504426676182.99999999999999999999720538018594909538656898697141084522414440557252073033365406 What happened here? n has only 21 digits, but using the default precision=38 digits failed to give the number of digits in 2^n using the "known" formula, without calculating 2^n. How was it possible? The reason is that n*log(2)/log(10) was very close to an integer. [even "only" 39 digits would be enough for this example]. Another example from me in this theme: https://trac.sagemath.org/ticket/10164 . 

20210414, 12:50  #8  
Feb 2017
Nowhere
3^{2}·5·101 Posts 
Quote:
c  p_{n}/q_{n} < 1/q_{n}q_{n+1} < 1/q_{n}^2. So this degree of closeness is guaranteed to occur infinitely many times. And, sure enough (I checked), 54668643504426676182/181605302766736484827 is a convergent to the SCF for c. Are any of the convergent fractions even better approximations to c, say c  p/q < 1/q^3 for some q > 10, say? I don't have a clue. To get q_{n+1} > q_{n}^2 the partial quotient a_{n} would have to be about as large as q_{n} itself. Using 10000 decimal digits precision, I had PariGP compute contfrac(log(2)/log(10)), which gave 9858 partial quotients, the largest of which was the 2837^{th} of 244049. This may seem large, but it is minuscule compared to the denominator of the 2837^{th} convergent! 

20210415, 06:33  #9  
Feb 2012
Prague, Czech Republ
3^{2}×19 Posts 
Quote:
"Size" is not well defined in this context. "Number of decimal" digits is, for example. From a programmer's POV, I'd assume "size" to mean how much memory one needs to store the number in a computer memory. Then the size is 106 949 789 bits and that is 13 368 723.625 bytes, confirming your "around 13000K". Last fiddled with by jnml on 20210415 at 06:33 

20210415, 13:59  #10  
"Robert Gerbicz"
Oct 2005
Hungary
3^{2}·163 Posts 
Quote:


20210415, 14:55  #11  
Feb 2017
Nowhere
11C1_{16} Posts 
Quote:


Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
2^8523486591 is a Mersenne Number or something  ONeil  ONeil  94  20180430 07:22 
Number of distinct prime factors of a Double Mersenne number  aketilander  Operazione Doppi Mersennes  1  20121109 21:16 
Number of Factors for a Mersenne Number  kurtulmehtap  Math  12  20100503 14:02 
product of the n first mersenne number  kerguilloud  Math  6  20050120 10:16 
A portrait of the mersenne number  romanesquefr  Miscellaneous Math  17  20041217 12:05 