Primality by Wilson's theorem: Difference between revisions

Add Draco
(Add BCPL)
(Add Draco)
Line 999:
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97</pre>
 
=={{header|Draco}}==
<syntaxhighlight lang="draco">proc wilson(word n) bool:
word f, i;
if n<2 then
false
else
f := n - 1;
for i from n-2 downto 2 do
f := (f*i) % n
od;
(f+1) % n = 0
fi
corp
 
proc main() void:
word i;
for i from 1 upto 100 do
if wilson(i) then
write(i, ' ')
fi
od
corp</syntaxhighlight>
{{out}}
<pre>2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97</pre>
=={{header|EDSAC order code}}==
{{trans|Pascal}}
2,114

edits