mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Closed Thread
 
Thread Tools
Old 2009-10-31, 16:25   #1
kokakola
 
Oct 2009

3 Posts
Default How many digits?

If I'm working on an LL test of N = 2^48,000,000 - 1, for example, is there any way for me to find how many digits N has?

Thanks!
kokakola is offline  
Old 2009-10-31, 16:55   #2
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17·251 Posts
Default

(with p being the exponent, the p in 2^p-1) The exact number is int(log_10(2^p)+1) = int(log_10(2)*p+1), which is roughly 0.3*p. Your example has exactly 14449440 (14.4 million) digits.
http://mersenne-aries.sili.net/digits.php calculates log_10(2^N), or the reverse (enter the digits to find the bits).
int(n) means the integer part of n. (e.g. int(4.8)=int(4.2)=int(4)=4)
log_10(2) is the base 10 logarithm of 2. (i.e. 10^(log_10(2))=2; it's about 0.3)

Last fiddled with by Mini-Geek on 2009-10-31 at 17:03
Mini-Geek is offline  
Old 2009-10-31, 17:20   #3
kokakola
 
Oct 2009

3 Posts
Default

Quote:
Originally Posted by Mini-Geek View Post
(with p being the exponent, the p in 2^p-1) The exact number is int(log_10(2^p)+1) = int(log_10(2)*p+1), which is roughly 0.3*p. Your example has exactly 14449440 (14.4 million) digits.
http://mersenne-aries.sili.net/digits.php calculates log_10(2^N), or the reverse (enter the digits to find the bits).
int(n) means the integer part of n. (e.g. int(4.8)=int(4.2)=int(4)=4)
log_10(2) is the base 10 logarithm of 2. (i.e. 10^(log_10(2))=2; it's about 0.3)
Thank you! Your formula is exactly what I was looking for.
kokakola is offline  
Old 2009-10-31, 17:37   #4
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

2×3×11×113 Posts
Default

Quote:
Originally Posted by kokakola View Post
If I'm working on an LL test of N = 2^48,000,000 - 1, for example, is there any way for me to find how many digits N has?

Thanks!
How much math have you had? Normally, one sees logarithms in
the 2nd or (maybe) 3rd year of high school algebra.
R.D. Silverman is offline  
Old 2009-10-31, 18:34   #5
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2·3·977 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
How much math have you had? Normally, one sees logarithms in
the 2nd or (maybe) 3rd year of high school algebra.
High schools offer three years of algebra?

But I agree, logs are a high school topic.
CRGreathouse is offline  
Old 2009-10-31, 19:39   #6
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
But I agree, logs are a high school topic.
True, but being able to connect the dots to realize that the exact formula for the number of digits in a number of the form 2^p-1 is int(log_10(2)*p+1) is not exactly what you learn when learning basic logarithms. Basic logarithmic theory would suggest that it's about log_10(2^p)=log_10(2)*p, but to recognize the problem as related to logarithms and rederive the exact formula would be a bit more difficult than you all seem to imply. And this is all assuming the OP has even learned logarithms.
Mini-Geek is offline  
Old 2009-11-01, 00:42   #7
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2·3·977 Posts
Default

Quote:
Originally Posted by Mini-Geek View Post
True, but being able to connect the dots to realize that the exact formula for the number of digits in a number of the form 2^p-1 is int(log_10(2)*p+1) is not exactly what you learn when learning basic logarithms. Basic logarithmic theory would suggest that it's about log_10(2^p)=log_10(2)*p, but to recognize the problem as related to logarithms and rederive the exact formula would be a bit more difficult than you all seem to imply. And this is all assuming the OP has even learned logarithms.
I have no argument with any of that, and would add the possibility that the OP learned it and forgot it.
CRGreathouse is offline  
Old 2009-11-01, 04:20   #8
kokakola
 
Oct 2009

3 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
How much math have you had? Normally, one sees logarithms in
the 2nd or (maybe) 3rd year of high school algebra.
I have taken a number of college level math courses. As others have pointed out, I just didn't make the connection.
kokakola is offline  
Old 2009-11-01, 20:05   #9
joblack
 
joblack's Avatar
 
Oct 2008
n00bville

52·29 Posts
Default

There is somewhere in the forum a Windows program which calculates the exact value ... search for it
joblack is offline  
Old 2009-11-01, 20:55   #10
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2×3×977 Posts
Default

Quote:
Originally Posted by joblack View Post
There is somewhere in the forum a Windows program which calculates the exact value ... search for it
That strikes me as overkill, since you can just as easily find it using Google as a calculator.
CRGreathouse is offline  
Old 2009-11-01, 21:57   #11
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

2×3×11×113 Posts
Default

Quote:
Originally Posted by Mini-Geek View Post
True, but being able to connect the dots to realize that the exact formula for the number of digits in a number of the form 2^p-1 is int(log_10(2)*p+1) is not exactly what you learn when learning basic logarithms.
Of course it is! Change of base is fundamental. I saw all of this,
IN CLASS in the 8th grade. i.e. the last year BEFORE high school.

Solving 2^x = 10^z is fundamental! It is totally trivial.

Last fiddled with by R.D. Silverman on 2009-11-01 at 21:57 Reason: typo
R.D. Silverman is offline  
Closed Thread

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum of Digits davar55 Puzzles 36 2015-12-18 15:47
15M Digits - Just For Fun storm5510 Math 7 2009-09-08 04:14
All 10 Digits davar55 Puzzles 5 2007-06-18 15:06
140+ digits which is better marthamm GMP-ECM 4 2006-01-25 17:32
Exponential Digits ndpowell Math 18 2005-07-15 22:31

All times are UTC. The time now is 16:45.

Thu Jul 16 16:45:52 UTC 2020 up 113 days, 14:18, 1 user, load averages: 1.44, 1.45, 1.51

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.