Sum of Divisors for OCaml Golf Competition by youz

(loop(format t"~A: ~A
"(set'n(read))(loop for i from 1 to(isqrt n)if(=(mod n i)0)sum(+(if(> #1=(/ n i)i)#1#0)i))))

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

download

return to the top page