Primality by Wilson's theorem: Difference between revisions

m
Line 1,232:
declare ( fmodp, i ) binary(15)fixed;
fmodp = 1;
do i = 12 to n - 1;
fmodp = mod( fmodp * i, n );
end;
return ( mod( fmodp + 1,= n )- = 01 );
end isWilsonPrime ;
do n = 21 to 100;
if isWilsonPrime( n ) then do;
put edit( n ) ( f(3) );
3,043

edits