RosettaCodeData/Task/Primality-by-Wilsons-theorem/BASIC256/primality-by-wilsons-theorem.basic
2023-07-01 13:44:08 -04:00

13 lines
272 B
Text

function wilson_prime(n)
fct = 1
for i = 2 to n-1
fct = (fct * i) mod n
next i
if fct = n-1 then return True else return False
end function
print "Primes below 100" & Chr(10)
for i = 2 to 100
if wilson_prime(i) then print i; " ";
next i
end