Sum of Divisors for OCaml Golf Competition by letter (rakuda)

let rec($)i?(x=read_int())s=x<i*2&2$1=Printf.printf"%d: %d
"x(x+s);($)~x(i+1)(s+x/i*i/x*i);;2$1

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

download

return to the top page