Sum of Divisors for OCaml Golf Competition by moe

let rec d a n=function 0->a|i->d(if n mod i=0 then i+a else a)n(i-1)and l()=let n=read_int()in Printf.printf"%d: %d\n"n(d 0 n n);l();;l() 

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

download

return to the top page