Sum of Divisors for OCaml Golf Competition by alan

let rec($)r?(x=read_int())d=d>x&(Printf.printf"%d: %d\n"x r;0$1);($)(if x mod d=0 then r+d else r)~x(d+1)in 0$1

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

download

return to the top page