20 lines
400 B
Text
20 lines
400 B
Text
include "isprime.kbs"
|
|
include "factorial.kbs"
|
|
|
|
print "First 10 factorial primes:"
|
|
found = 0
|
|
i = 1
|
|
while found < 9
|
|
fct = factorial (i)
|
|
|
|
if isprime(fct-1) then
|
|
found += 1
|
|
print rjust(string(found),2); ": "; rjust(string(i),2); "! - 1 = "; fct-1
|
|
end if
|
|
if isprime(fct+1) then
|
|
found += 1
|
|
print rjust(string(found),2); ": "; rjust(string(i),2); "! + 1 = "; fct+1
|
|
end if
|
|
i += 1
|
|
end while
|
|
end
|