Sum of Divisors for OCaml Golf Competition by adukar

(**********************************************)
(* Sum of Divisors for OCaml Golf Competition *)
(**********************************************)
let rec(!)s?(n=read_int())i=2*i>n&(Printf.printf"%d: %d
"n(s+n);!0)1;!(s+n/i*i/n*i)~n(i+1);;!0 1

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page