Sum of Divisors for OCaml Golf Competition by kozima

(loop(setf n(read)r(isqrt n))(format t"~D: ~D
"n(-(loop for k from 1 to r if(=(mod n k)0)sum(+(/ n k)k))(if(=(* r r)n)r 0))))

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

download

return to the top page