let range s e = let rec f r s e = if s = e then r else f (s::r) (s + 1) e in List.rev @@ f [] s e;; let foldl1 f xs = match xs with x::xs -> List.fold_left (+) x xs;; ((fun x -> x * x) @@ foldl1 (+) @@ range 1 101) - (foldl1 (+) @@ List.map (fun x -> x * x) @@ range 1 101);;