Sum of Divisors for OCaml Golf Competition by yoshihiro503(rakuda)

let rec($)n i s=n<i&(Printf.printf"%d: %d\n"n s;((read_int())$1)0)||n mod i=0&(n$i+1)(s+i)||(n$i+1)s;;try((read_int())$1)0 with _->0=0

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

download

return to the top page