anemone said:
Find all pairs $(a,\,b)$ of integers such that $1998a+1996b+1=ab$.
[sp]Write the equation as $1997(a+b) = (a+1)(b-1)$. Since $1997$ is prime, it follows that either $a+1$ or $b-1$ must be a multiple of $1997$.
Case 1. If $a+1 = 1997k$ then (after cancelling $1997$ from both sides) the equation becomes $1997k-1+b = k(b-1)$, from which $k = \dfrac{1-b}{1998-b} = 1 - \dfrac{1997}{1998-b}.$ Again using the fact that $1997$ is prime, we see that $1998-b$ must be $\pm1$ or $\pm 1997$. That gives four values for $b$, namely $1,\ 1997,\ 1999,\ 3995$. The corresponding values for $k$ are $0,\ -1996,\ 1998,\ 2$, with $a = -1,\ -3986013,\ 3990005,\ 3993$.
Case 2. If $b-1 = 1997k$ then the equation becomes $a + 1997k + 1 = k(a+1)$, from which $k = \dfrac{a+1}{a-1996} = 1 - \dfrac{1997}{1996-a}.$ Thus $a-1996$ must be $\pm1$ or $\pm 1997$. That gives four values for $a$, namely $-1,\ 1995,\ 1997,\ 3993$. The corresponding values for $k$ are again $0,\ -1996,\ 1998,\ 2$, with $b = 1,\ -3986011,\ 3990007,\ 3995$.
Two of those solutions appear in both sets, so there are six solutions altogether, namely $(a,b) = (-1,1),\ (3993,3995),\ (1995,-3986011),\ (1997,3990007),\ (-3986013,1997),\ (3990005,1999).$[/sp]
Edit. kaliprasad's method is neater, avoiding the duplicate solutions that I had.