Sum of Divisors for OCaml Golf Competition by 51b

-module(s).
-export([m/0]).
m()->case io:fread('',"~d")of{_,[N]}->io:format("~p: ~w
",[N,f(N,N)]),m();_->0end.
f(_,0)->0;f(N,I)->if N rem I<1->I;0<1->0end+f(N,I-1).

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

download

return to the top page