14 lines
271 B
Text
14 lines
271 B
Text
|
|
print "Primes below 100"
|
||
|
|
for i = 2 to 100
|
||
|
|
if wilsonprime(i) = 1 then print i; " ";
|
||
|
|
next i
|
||
|
|
end
|
||
|
|
|
||
|
|
function wilsonprime(n)
|
||
|
|
fct = 1
|
||
|
|
for i = 2 to n-1
|
||
|
|
fct = (fct * i) mod n
|
||
|
|
next i
|
||
|
|
if fct = n-1 then wilsonprime = 1 else wilsonprime = 0
|
||
|
|
end function
|