Sum of Divisors for OCaml Golf Competition by 51b

define(g,`ifelse(eval($1<$2*$2),1,$3,`g($1,incr($2),eval($3+!($1%$2)*($2+($1!=$2*$2)*$1/$2)))')')define(f,`ifelse($1,,,`$1: g($1,1,0)
f(shift($@))')')f(translit(include(/dev/fd/0),`
',`,'))

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

download

return to the top page