Totient by m.ukai

let rec f n p x b r s=if mod_float n p=0.then f(n/.p)p(x*.p)x r s
else if n>p*.p then f n(p+.1.+.s)1. 0.(r*.(x-.b))1.else Printf.printf"%0.f
"(r*.(x-.b)*.if n=1.then 1.else n-.1.);;while 1=1do
f(read_float())2. 1. 0. 1. 0.done

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

download

return to the top page