摘要:
procedure euler;
var
i,j:longint;
begin
phi[1]:=1;
for i:=2 to n do
begin
if not mark[i] then
begin
inc(tot);
p[tot]:=i;
phi[i]:=i-1;
end;
for j:=1 to n do
begin
if i*p[j]>n then break;
mark[i*p[j]]:=true;
if i mod p[j]=0 then
begin
phi[i*p[j]]:=phi[i]*p[j];
break; 阅读全文