Sum of Divisors for OCaml Golf Competition by yoshihiro.oyama (rakuda)

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

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

download

return to the top page