Data update
This commit is contained in:
parent
8f05c7136f
commit
0bf4da02c3
82 changed files with 2194 additions and 118 deletions
29
Task/Factorial-primes/Craft-Basic/factorial-primes.basic
Normal file
29
Task/Factorial-primes/Craft-Basic/factorial-primes.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue