Sum of Divisors for OCaml Golf Competition by nn

System.in.eachLine{n=it.toLong()
for(s=i=0;0>(u=++i*i-n);)n%i||(s+=i+n/i)
println"$n: ${u?s:s+i}"}

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

download

return to the top page