mersenneforum.org Number Of Digits; I Hate To Ask
 Register FAQ Search Today's Posts Mark Forums Read

 2009-09-06, 19:17 #1 storm5510 Random Account     Aug 2009 19×101 Posts 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
 2009-09-06, 19:35 #2 frmky     Jul 2003 So Cal 2·3·347 Posts 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.
2009-09-06, 19:54   #3
storm5510
Random Account

Aug 2009

77F16 Posts

Quote:
 Originally Posted by frmky 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?

2009-09-06, 20:15   #4
Mini-Geek
Account Deleted

"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts

Quote:
 Originally Posted by storm5510 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 )

 2009-09-06, 20:31 #5 storm5510 Random Account     Aug 2009 35778 Posts 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
 2009-09-06, 20:35 #6 Mini-Geek Account Deleted     "Tim Sorbera" Aug 2006 San Antonio, TX USA 17×251 Posts Yep, you've got it.
2009-09-06, 21:52   #7
Dougy

Aug 2004
Melbourne, Australia

2308 Posts

Quote:
 Originally Posted by frmky 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.

 2009-09-06, 22:09 #8 CRGreathouse     Aug 2006 10111011000012 Posts 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.
 2009-09-06, 23:24 #9 Dougy     Aug 2004 Melbourne, Australia 23·19 Posts Hmmm... this should be on the Mersenne Wiki.
 2009-09-07, 00:16 #10 Batalov     "Serge" Mar 2008 Phi(4,2^7658614+1)/2 100100101011012 Posts
 2009-09-07, 01:23 #11 storm5510 Random Account     Aug 2009 19×101 Posts 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.

 Similar Threads Thread Thread Starter Forum Replies Last Post sinide Factoring 12 2010-11-09 01:05 aaa120 Factoring 19 2010-09-04 09:16 abc_temp Factoring 14 2007-12-23 20:25 grobie 15k Search 13 2005-09-29 21:57 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