For[num = 2, 
      num < 10, num++, 
eq1 =  
        Sum[X^i Y^j, {i, 1, num}, {j, 1, num}] == 
          1; 
eq2 =  
        Sum[i/j X^i Y^j, {i, 1, num}, {j, 1, num}] == 
          1/2; 
sol = 
        NSolve[{eq1, eq2}, {X, Y}] ; 
soll = 
        Table[{N[X  /.  sol[[ii]]], N[Y  /.  sol[[ii]]]}, {ii, 
            1, Dimensions[
                sol][[1]]}]; 
Print["N=", 
        num, "\n"]; 
Print[
        Select[soll, 
          Im[#[[2]]] == 
              0.0 &]];
]