tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
6
Task/Prime-decomposition/Pure/prime-decomposition.pure
Normal file
6
Task/Prime-decomposition/Pure/prime-decomposition.pure
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
factor n = factor 2 n with
|
||||
factor k n = k : factor k (n div k) if n mod k == 0;
|
||||
= if n>1 then [n] else [] if k*k>n;
|
||||
= factor (k+1) n if k==2;
|
||||
= factor (k+2) n otherwise;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue