mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Other Mathematical Topics

Reply
 
Thread Tools
Old 2009-09-06, 19:17   #1
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009

19×101 Posts
Default Number Of Digits; I Hate To Ask

Is there a formula for calculating the number of digits in a large number?

An example would be 218477

storm5510 is offline   Reply With Quote
Old 2009-09-06, 19:35   #2
frmky
 
frmky's Avatar
 
Jul 2003
So Cal

2·3·347 Posts
Default

Yes, take the base-10 log, and round up.

log (2^18477) = 18477 log 2 = 18477 (0.30103) = 5562.1

so 2^18477 has 5563 digits.
frmky is offline   Reply With Quote
Old 2009-09-06, 19:54   #3
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009

77F16 Posts
Default

Quote:
Originally Posted by frmky View Post
18477 log 2 = 18477 (0.30103) = 5562.1
Okay, thanks. I'm trying to do this on my TI hand-held calculator. It has "LOG" and "LN" I can't seem to replicate the example. "Log 2" above is base 2 logarithm?
storm5510 is offline   Reply With Quote
Old 2009-09-06, 20:15   #4
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts
Default

Quote:
Originally Posted by storm5510 View Post
Okay, thanks. I'm trying to do this on my TI hand-held calculator. It has "LOG" and "LN" I can't seem to replicate the example. "Log 2" above is base 2 logarithm?
In this case, frmky is only using the base 10 logarithm. When he said "log 2", he was referring to the base 10 logarithm of 2, which is about 0.30103. (keep in mind that log(y^x)=x*log(y), hence the importance of knowing what log(2) is)
The "LOG" button on your calculator is (almost certainly, anyway - just try log(1000) or something to check) the base 10 logarithm.

I doubt you'll be able to replicate the first step on your calculator, since if it's anything like my TI, it has a limit of 100 digits. You can, however, replicate the rest. Note that 0.30103 is not exactly log_10(2), but is close enough for this example.

If you did need the base x logarithm of y, you could use log(y)/log(x). (with log being the logarithm of any base, surprising as that may sound )
Mini-Geek is offline   Reply With Quote
Old 2009-09-06, 20:31   #5
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009

35778 Posts
Default

On my calculator if I enter 1000 and press Log, it returns 3, meaning 103

Entering 2 and pressing Log gives me .301029996. This is the rounded number in his example.

Multiply that times 18477 and i get 5562.1.

It seems to work.

On the GIMPS home page is 242643801. If I do this like above, then I get 12,837,063.2
storm5510 is offline   Reply With Quote
Old 2009-09-06, 20:35   #6
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts
Default

Yep, you've got it.
Mini-Geek is offline   Reply With Quote
Old 2009-09-06, 21:52   #7
Dougy
 
Dougy's Avatar
 
Aug 2004
Melbourne, Australia

2308 Posts
Default

Quote:
Originally Posted by frmky View Post
Yes, take the base-10 log, and round up.

log (2^18477) = 18477 log 2 = 18477 (0.30103) = 5562.1

so 2^18477 has 5563 digits.
Although this method does not work if your number is a power of ten. For example \log_{10} 100=2 whereas 100 has three digits.
Dougy is offline   Reply With Quote
Old 2009-09-06, 22:09   #8
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111011000012 Posts
Default

Yes, the 'right' way is to round down and add one. But usually you'd know if you were dealing with a power of 10.
CRGreathouse is offline   Reply With Quote
Old 2009-09-06, 23:24   #9
Dougy
 
Dougy's Avatar
 
Aug 2004
Melbourne, Australia

23·19 Posts
Default

Hmmm... this should be on the Mersenne Wiki.
Dougy is offline   Reply With Quote
Old 2009-09-07, 00:16   #10
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

100100101011012 Posts
Arrow

http://mersenneforum.org/showthread.php?t=3321
Batalov is offline   Reply With Quote
Old 2009-09-07, 01:23   #11
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009

19×101 Posts
Default

http://www.mersenne.org/bench.htm

This link is broken. It is in the last post of the thread above. Understandable. All of this is from 2004.
storm5510 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
who can help me factor this 155 digits number sinide Factoring 12 2010-11-09 01:05
who can factor this 128 digits number? aaa120 Factoring 19 2010-09-04 09:16
Factoring 132-digits Number abc_temp Factoring 14 2007-12-23 20:25
Number of digits display grobie 15k Search 13 2005-09-29 21:57
how do you find number of digits of a 2^n number? Unregistered Math 11 2004-11-30 22:53

All times are UTC. The time now is 23:25.

Mon Apr 12 23:25:47 UTC 2021 up 4 days, 18:06, 1 user, load averages: 2.45, 2.33, 2.36

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.