- Two rather silly things.

Firstly, after pulling a completely random number out of the air rather than actually remembering the error-bound in Yves initial 'FFT' mail, I decided to start rechecking a 'Proth' prime that was in fact valid anyway, but using a non-FFT method.

I now 'proudly' present what I believe to be the world's largest non-FFT-proved prime! (one of David Underbakke's)

116691*2^337001+1 .

Certainly a target nearly as sensible as Paul Jobling's faux Titanix prime which was in the most part made from N+/-1 steps rather than EC steps.

Secondly, I decided to start code-reviewing and verifying some other FFT code used in the prime arena. The particular code I looked at appeared to not suffer from the overflow risk problem! Not only that, but I managed to optimise it too!

So I also, even more proudly, present what I believe to be the world's smallest C program to print the world's largest prime!

#define P for(p=t;p<t+N;

int m=754974721,N,t[1<<22],*p,i,e

=4625195,j,s,c,U;f(d){for(s=1<<23

;s;d=d*1LL*d%m,s/=2)if(s<N)P p+=s

)for(i=s,c=1;i;i--)j=*p+p[s],p[s]

=(m+*p-p[s])*1LL*c%m,*p++=j%m,c=c

*1LL*d%m;for(j=0;++i<N;){for(c=N/

2;!((j^=c)&c);c/=2);i<j?t[i]^=t[j

]^=t[i]^=t[j]:0;}}main(){for(*t=2

,U=N=1;e/=2;){U=U*1LL*(m+1)/2%m;N

*=2;f(362);P)*p++=*p*1LL**p%m*U%m

;f(415027540);P)s+=*p<<(e&1),*p++

=s%10,s/=10;}for(--*t;p>t;)(e|=*

--p)&&printf("%d",*p);}

Yes, it's based on Fabrice's Bellard's IOCCC entry from last year. However, it's over 30 bytes (about 7%) shorter.

(It takes a few minutes to run, and produces >2MB of numeric output.)

Enjoy,

Phil

Mathematics should not have to involve martyrdom;

Support Eric Weisstein, see http://mathworld.wolfram.com

Find the best deals on the web at AltaVista Shopping!

http://www.shopping.altavista.com - On Wed, 20 June 2001, Christ van Willegen wrote:
> Yes, but Phil does this _every_time_.

Oh dear, am I becoming predictable?

> Some time ago, Phil contributed an 'illegal' prime into Chris'

It was a different piece of code, one by Charles Hannum, that I shrank.

> database (he one that, you know, contains the highly illegal

> source to decrypting DVD's. Oh my, now mathematics _itself_ may

> be sued by the MPAA/RIAA if we're not careful). If I remember

> correctly, he got his hands onto the program before turning

> it into a prime, optimizing the code even further. He even

> Phil, thanks for optimizing everything you see!

Maybe just once I'll turn my hand to something useful.

Naaaaaah!

Phil

Mathematics should not have to involve martyrdom;

Support Eric Weisstein, see http://mathworld.wolfram.com

Find the best deals on the web at AltaVista Shopping!

http://www.shopping.altavista.com