8. Find all integers $k$ such that there exist positive integers $a$ and $b$ satisfying
$$
\frac{b+1}{a}+\frac{a+1}{b}=k .
$$
(Proposed by Yonggao Chen)
8. For a fixed $k$, among the pairs $(a, b)$ that satisfy the given equation, choose a pair $(a, b)$ such that $b$ is the smallest, then
$$
x^{2}+(1-k b) x+b^{2}+b=0
$$

has one root $x=a$. Let the other root be $x=a^{\prime}$. Then from $a+a^{\prime}=k b-1$, we know $a^{\prime} \in \mathbf{Z}$, and $a a^{\prime}=b(b+1)$.
Therefore, $a^{\prime}>0$.
Also, $\frac{b+1}{a^{\prime}}+\frac{a^{\prime}+1}{b}=k$, by the assumption on $b$ we have $a \geqslant b, a^{\prime} \geqslant b$.
Thus, one of $a, a^{\prime}$ must be $b$, without loss of generality, let $a=b$.
Then, $k=2+\frac{2}{b}$.
So, $b=1,2$.
Hence, $k=3,4$.
(Provided by Neng Bin)