Nếu có sai thì bạn nói mình nhé.
============================
Program Hello;
Var a,b,n,i,j,s:integer;
Function tuoc(a:integer):integer;
Begin
s:=0;
For b:=2 to trunc(a div 2) do
if (a mod b = 0) then
s:=s + b;
tuoc:=s;
End;
Begin
Readln(n);
For i:=1 to n do
for j:= i+1 to n do
if (tuoc(i) = j) and (i= tuoc(j)) then
Writeln(i,'-',j);
Readln;
End.