the need for 64 bits

Mensanator mensanator at aol.com
Mon Dec 28 13:39:32 EST 2009


On Dec 28, 9:08 am, casevh <cas... at gmail.com> wrote:
> On Dec 28, 2:13 am, Mark Dickinson <dicki... at gmail.com> wrote:
>
>
>
>
>
> > On Dec 28, 6:50 am, Mensanator <mensana... at aol.com> wrote:
>
> > > But with a 64-bit processor, that limitation no longer stops me.
>
> > > i: 11   bits: 10,460,353,205   decimals:  3,148,880,080
> > > i: 12   bits: 94,143,178,829   decimals: 28,339,920,715
>
> > > Wow! 94 billion bits! 28 billion decimal digits!
>
> > > Of course, once one wall falls, you get to go up against the next
> > > one.
> > > For generation 13, I get:
>
> > > gmp: overflow in mpz type
> > > Abort trap
>
> > > Hmm, not sure what "overflow" means in this context, but I suspect
> > > it ran out of memory, I probably should have gotten the MacBook Pro
> > > with 8 GB of ram. But then, maybe it wouldn't help.
>
> > I don't think this was due to running out of memory:  it looks like
> > gmp uses the 'int' C type to count the number of limbs in an mpz,
> > which would make the maximum number of bits 2**31 * 64, or around 137
> > billion, on a typical 64-bit machine.  Maybe there's a configure
> > option to change this?
>
> > For Python longs, the number of limbs is stored as a signed size_t
> > type, so on a 64-bit machine memory really is the only limitation.
>
> > --
> > Mark
>
> Based on comments on the GMP website, the maximum number of bits on a
> 64-bit platform is limited to 2**37 or 41 billion decimal digits.

I guess that eliminates ever finding generation 13. :-)

And I haven't checked the 12th generation number yet.
I can calculate it, but I don't if I can actually run it
through the Collatz process. Being a Mersenne Number, the
excursion (maximum value reached in the sequence) will be
about 1.585 times as many bits as the starting number.
If that fails with genertaion 12, then finding generation
13 is moot.

> A number this size requires 16GB of RAM.

Ah, the 8 GB Mac wouldn't have helped. Glad I didn't spend the extra
$1000.

> A future version of GMP (5.x)
> is supposed to remove that limit and also work well with disk-based
> storage.

Something to look forward to.

Thanks, guys.

>
> casevh




More information about the Python-list mailing list