How to get decimal form of largest known prime?

Rick Holbert holbertr at dma.org
Fri Jun 11 08:40:09 EDT 2004


Yes, for base ten the ratio can be computed as follows:

from math import log

print log(10)/log(2)

Carl Banks wrote:

> Daniel Yoo wrote:
>> Yikes.  I introduced an order-of-magnitude bug when defining x.  Let
>> me recalculate that:
>> 
>> ###
>>>>> x = 2**24036583 - 1
>>>>> digits(x)
>> 7235733
>> ###
>> 
>> Ok, so there's about 7 million digits in that thing.  Slightly more
>> difficult to print out.  *grin*
> 
> It's usually easier than that to get an estimate: the number of digits
> in 2**n is roughly n/3  (n/3.32192809488736234786 to be exact. :).
> 
> 

-- 
o



More information about the Python-list mailing list