Pagini recente » Cod sursa (job #1456716) | Cod sursa (job #526140) | Cod sursa (job #2120805) | Cod sursa (job #401660) | Cod sursa (job #302397)
Cod sursa(job #302397)
var i,n,j,a,b,cn,r:longint;
f,g:text;
begin
assign(f,'fractii.in');
assign(g,'fractii.out');
reset(f);
rewrite(g);
readln(f,n);
cn:=2*n-1;
for i:=2 to n do
for j:=2 to n do
begin
if (i<>j) then
begin
a:=i;
b:=j;
while a mod b<>0 do
begin
r:=a mod b;
a:=b;
b:=r;
end;
if b=1 then inc(cn);
end;
end;
write(g,cn);
close(f);
close(g);
end.