Sum of Divisors for OCaml Golf Competition by Yak!

while true do let k=read_int()and t=ref 1 in(for i=2 to k do t:=!t+(if k/i*i=k then i else 0)done;Printf.printf"%d: %d\n"k!t)done

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

download

return to the top page