Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Ludic-numbers/Standard-ML/ludic-numbers.ml
Normal file
20
Task/Ludic-numbers/Standard-ML/ludic-numbers.ml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
open List;
|
||||
|
||||
fun Ludi [] = []
|
||||
| Ludi (T as h::L) =
|
||||
let
|
||||
fun next (h:: L ) =
|
||||
let
|
||||
val nw = #2 (ListPair.unzip (filter (fn (a,b) => a mod #2 h <> 0) L) )
|
||||
in
|
||||
ListPair.zip ( List.tabulate(List.length nw,fn i=>i) ,nw)
|
||||
end
|
||||
in
|
||||
h :: Ludi ( next T)
|
||||
end;
|
||||
|
||||
val ludics = 1:: (#2 (ListPair.unzip(Ludi (ListPair.zip ( List.tabulate(25000,fn i=>i),tabulate (25000,fn i=>i+2)) )) ));
|
||||
|
||||
app ((fn e => print (e^" ")) o Int.toString ) (take (ludics,25));
|
||||
length (filter (fn e=> e <= 1000) ludics);
|
||||
drop (take (ludics,2005),1999);
|
||||
Loading…
Add table
Add a link
Reference in a new issue