Factorial primes: Difference between revisions
Content added Content deleted
mNo edit summary |
Basicgames (talk | contribs) |
||
Line 135: | Line 135: | ||
end while |
end while |
||
end</syntaxhighlight> |
end</syntaxhighlight> |
||
==={{header|Craft Basic}}=== |
|||
<syntaxhighlight lang="basic">define found = 0, fct = 0, i = 1 |
|||
do |
|||
if found < 10 then |
|||
let fct = factorial(i) |
|||
if prime(fct - 1) then |
|||
let found = found + 1 |
|||
print found, ": ", i, "! - 1 = ", fct - 1 |
|||
endif |
|||
if prime(fct + 1) then |
|||
let found = found + 1 |
|||
print found, ": ", i, "! + 1 = ", fct + 1 |
|||
endif |
|||
let i = i + 1 |
|||
endif |
|||
wait |
|||
loop found < 10</syntaxhighlight> |
|||
==={{header|FreeBASIC}}=== |
==={{header|FreeBASIC}}=== |