RosettaCodeData/Task/Factorial-primes/Yabasic/factorial-primes.basic
2023-07-01 13:44:08 -04:00

19 lines
414 B
Text

import isprime
import factorial
print "First 10 factorial primes:"
found = 0
i = 1
while found < 10
fct = factorial (i)
if isPrime(fct-1) then
found = found + 1
print found using("##"), ": ", i using("##"), "! - 1 = ", fct-1
fi
if isPrime(fct+1) then
found = found + 1
print found using("##"), ": ", i using("##"), "! + 1 = ", fct+1
fi
i = i + 1
end while