totient function by murky-satyr

for i=1e4,10300 do
r,n,j=i,i,2
while n>1 do
r=n%j<1 and r-r/j or r
while n%j<1 do n=n/j end
j=j+1
end
print(r)end

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

download

return to the top page