<s>[INST] Find all the integer pairs $(r,s)$ that satisfy $s= (r^2 +3r +8) / (r^2 +r -2)$? I have been trying to solve this question but struggling to see where to start. Examples I've seen that works are the pairs: $(-3,2) , (4,2), (0,-4)$ 
 [/INST] If integer $d>0$ divides both  $r^2+3r+8, r^2+r-2;$
$d$ must divide  $r^2+3r+8-(r^2+r-2)=2r+10$
$d$ must divide  $r(2r+10)-2(r^2+3r+8)=4r-16$
$d$ must divide  $2(2r+10)-(4r-16)=36$
So, $r^2+r-2=(r+2)(r-1)$ must divide $36$
Now as $r+2-(r-1)=3; 3|(r+2)\iff3|(r-1)$
Case$\#1:$ If $3|(r+2),$ let $r=3s+1\implies s(s+1)|4$ 
so $s(s+1)$ can not have an odd factor $>1\implies s=1,-2\implies r=?,?$
Case$\#2:$ If $3\nmid(r+2),(r+2)(r-1)$ must divide $4\implies r=2,0$
</s>