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

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

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

download

return to the top page