View Single Post
Old 2006-10-19, 23:52   #2
jocelynl
 
Sep 2002

2×131 Posts
Default

here is a revised one

Code:
   15   M=2
   20   M=nxtprm(M)
   30   N=2^M-1
   40   N2=sft(N,-1)
   50   B=modpow(3,N2,N)
   54   N3=sft(N-N2,-1)
   55   B=modpow(B,N3,N)
   75   if B=1 then print "2^";M;"-1 is prime":goto 20
   80   goto 20
Can anyone try this in C++ to see if there's any speed difference at higher m values I really don't see any below 4000.

Joss

Last fiddled with by jocelynl on 2006-10-19 at 23:58
jocelynl is offline   Reply With Quote