The answer is 5.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

Since $a$ divides $b+1$ and $b$ divides $a+1$ , we must have $a \le b+1$ and $b \le a+1$ , so that $a-1 \le b \le a+1$ . There are three cases to consider:

If $b = a-1$ we need $a-1$ to divide $a+1$ , and hence we need $a-1$ to divide $2$ . Thus $a-1$ is either $1$ or $2$ , giving the solutions $(2,1)$ and $(3,2)$ .

If $b=a$ we need $a$ to divide $a+1$ , and hence we need $a$ to divide $1$ . Thus $a=1$ , giving the solution $(1,1)$ .

If $b = a+1$ we need $a$ to divide $a+2$ , and hence we need $a$ to divide $2$ . Thus $a$ is either $1$ or $2$ , giving the solutions $(1,2)$ and $(2,3)$ .

Thus there are a total of $\boxed{5}$ solutions.