Sum of Divisors for OCaml Golf Competition by pooq

File standardInput readLines map(asNumber)map(n,s:=1+n;for(i,2,n**.5,s=s+if(n%i<1,if(i==n/i,i,i+n/i),0));writeln(n,": ",s))

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

download

return to the top page