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

while 1<2do let n,s=read_int(),ref 0in for i=1to n do(n=n/i*i)&(s:=!s+i;1<2)done;Printf.printf"%d: %d
"n!s done

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

download

return to the top page