Lucas-Lehmer test: Difference between revisions
→{{header|BBC BASIC}}
No edit summary |
Basicgames (talk | contribs) |
||
Line 581:
M19
</pre>
==={{header|Craft Basic}}===
<syntaxhighlight lang="basic">let m = 7
let n = 1
for e = 2 to m
if e = 2 then
let s = 0
else
let s = 4
endif
let n = (n + 1) * 2 - 1
for i = 1 to e - 2
let s = (s * s - 2) % n
next i
if s = 0 then
print e, " ",
endif
next e</syntaxhighlight>
{{Out}}
<pre>2 3 5 7 </pre>
=={{header|BCPL}}==
|