totient function by uru

var i,c,n:word=10000;begin
repeat
c:=n;i:=n;for n:=2to n do
if i mod n=0then begin while i mod n=0do i:=i div n;c:=c*(n-1)div n;end;writeln(c);inc(n)until n>10300end.

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

download

return to the top page