Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Prime-decomposition/Ela/prime-decomposition.ela
Normal file
9
Task/Prime-decomposition/Ela/prime-decomposition.ela
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
open integer //arbitrary sized integers
|
||||
|
||||
decompose_prime n = loop n 2I
|
||||
where
|
||||
loop c p | c < (p * p) = [c]
|
||||
| c % p == 0I = p :: (loop (c / p) p)
|
||||
| else = loop c (p + 1I)
|
||||
|
||||
decompose_prime 600851475143I
|
||||
Loading…
Add table
Add a link
Reference in a new issue