Distribution of twin primes

all at abouthugo.de all at abouthugo.de
Fri Jan 23 19:56:02 CET 2004


"Eric W. Weisstein" <eww at wolfram.com> schrieb am 23.01.2004, 16:22:18:
> On Fri, 23 Jan 2004 f.firoozbakht at sci.ui.ac.ir wrote:
> 
> > Dear seqfans,
> > 
> > I have worked with Mathematica since 13 years ago.
> > I had faced with such a problem whenever the procedure got near to a 
> > ten-digit prime.
> > The procedure used to generated negative numbers and got returned.
> > This strange prime is p=2147483647.

It's just 2^31-1, the 8th Mersenne prime A000043(8), a number every
programmer of 32bit computers knows as the largest one representible
in signed 32bit integers on many popular computers. If you add 1
without checking for overflow, the representation in two's complement
gives -2^31, the smallest 32bit signed integer. It takes some trouble
in programming to avoid this boundary without loosing performance. I
spent weeks of my life fighting against overflow at 2^15-1 and 2^31-1,
and finally always succeeded (as did Mathematica ;-).

Hugo





More information about the SeqFan mailing list