totient function by uru

301.times{|i|e=j=f=1
i+=1e4
i%(j+=1)<1&&[e*=j-1+f/j,i/=f=j,j=1]while i>1
p e}

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

download

return to the top page