while (k>0) AND (pp=1) k= k-1 a=int(rnd(1)*(n-4))+2 x= Euler(a,d,n) if (x=1) or (x=c) then goto [NxLoop] r= s-1 while r<>0 r= r-1 x= (x*x) MOD n if x= 1 then exit while if x= c then pp= 2 : exit while wend pp= pp-1 wend
That's what I have so far. Apparently the error in the outer loop was being caused by breaking the FOR in the inner loop. Don't know, but I got it working. Still don't understand the math completely. 😏
Forgot to mention that I cut and pasted a bit of code from Rosetta to check for small primes.
Last Edit: Mar 18, 2021 9:07:33 GMT -5 by mayhew61