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

let rec y c x s=if c>x then s else y(c+1)x(s+if x mod c>0 then 0 else c)in while 1>0 do let x=read_int()in Printf.printf"%d: %d\n"x(y 1 x 0) done

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

download

return to the top page