![]() |
|
|
#1 |
|
Feb 2020
France
216 Posts |
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) |
|
|
|
|
|
#2 |
|
Einyen
Dec 2003
Denmark
35×13 Posts |
You can find the number of digits by taking the base 10 logarithm and rounding up:
log10(2106949789) = 106949789* log10(2) = 106949789 * 0.301030 = 32195094.5 So the number is 32,195,095 digits long. Last fiddled with by ATH on 2020-02-29 at 12:09 |
|
|
|
|
|
#3 |
|
Feb 2020
France
2 Posts |
it's fine
TY |
|
|
|
|
|
#4 |
|
"David Kirkby"
Jan 2021
Althorne, Essex, UK
2×3×61 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.
|
|
|
|
|
|
#5 |
|
Jun 2003
116738 Posts |
|
|
|
|
|
|
#6 | |
|
Feb 2017
Nowhere
4,643 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 108, 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. |
|
|
|
|
|
|
#7 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
22·7·53 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 . |
|
|
|
|
|
|
#8 | |
|
Feb 2017
Nowhere
4,643 Posts |
Quote:
|c - pn/qn| < 1/qnqn+1 < 1/qn^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 qn+1 > qn^2 the partial quotient an would have to be about as large as qn itself. Using 10000 decimal digits precision, I had Pari-GP compute contfrac(log(2)/log(10)), which gave 9858 partial quotients, the largest of which was the 2837th of 244049. This may seem large, but it is minuscule compared to the denominator of the 2837th convergent! |
|
|
|
|
|
|
#9 | |
|
Feb 2012
Prague, Czech Republ
101100102 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 2021-04-15 at 06:33 |
|
|
|
|
|
|
#10 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
22·7·53 Posts |
Quote:
|
|
|
|
|
|
|
#11 | |
|
Feb 2017
Nowhere
4,643 Posts |
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2^852348659-1 is a Mersenne Number or something | ONeil | ONeil | 94 | 2018-04-30 07:22 |
| Number of distinct prime factors of a Double Mersenne number | aketilander | Operazione Doppi Mersennes | 1 | 2012-11-09 21:16 |
| Number of Factors for a Mersenne Number | kurtulmehtap | Math | 12 | 2010-05-03 14:02 |
| product of the n first mersenne number | kerguilloud | Math | 6 | 2005-01-20 10:16 |
| A portrait of the mersenne number | romanesquefr | Miscellaneous Math | 17 | 2004-12-17 12:05 |