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

let rec f?(s=ref 0)?(n=read_int())u=for i=1to n do
n/i*i=n&u=(s:=!s+i)done;f(Printf.printf"%d: %d
"n!s);;f()

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

download

return to the top page