Totient by tails

#!perl -pl
$n=$_;$d=2;0while$n%$d?++$d**2<$n:($n/=$d)%$d?$_-=$_/$d:1;$_-=$_/$n%$_

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

download

return to the top page