Sum of Divisors for OCaml Golf Competition by kozima

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

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

download

return to the top page