Sum of Divisors for OCaml Golf Competition by kik

while 0=0do
let x,y=read_int(),ref 0in
for z=1to x do y:=!y+z*Obj.magic(x/z*z=x)done;Printf.printf"%d: %d
"x!y done

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

download

return to the top page