18. Find the number of 2-element subsets $\{a, b\}$ of $\{1,2,3, \ldots, 99,100\}$ such that $a b+a+b$ is a multiple of 7 .
18. Answer: 602
Note that $a b+a+b=(a+1)(b+1)-1$. Thus $a b+a+b$ is a multiple of 7 if and only if $(a+1)(b+1)=1(\bmod 7)$.
Let $A=\{1,2,3, \ldots, 99,100\}$, and let $A_{i}=\{x \in A: x=i(\bmod 7)\}$ for $i=0,1$, $2, \ldots, 6$. It is easy to verify that for any $x \in A_{i}$ and $y \in A_{j}$, where $0 \leq i \leq j \leq 6$, $x y=1(\bmod 7)$ if and only if $i=j \in\{1,6\}$, or $i=2$ and $j=4$, or $i=3$ and $j=5$.
Thus we consider three cases.
Case 1: $a+1, b+1 \in A$ for $i \in\{1,6\}$.
Then $a, b \in A_{1}$ for $i \in\{0,5\}$. As $\left|A_{0}\right|=\left|A_{9}\right|=14$, the number of such subsets $\{a, b\}$ is $2\binom{14}{2}=182$.
Case 2: $a+1$ and $b+1$ are contained in $A_{2}$ and $A_{4}$ respectively, but not in the same set.
Then $a$ and $b$ are contained in $A_{1}$ and $A_{3}$ respectively, but not in the same set. Since $\left|A_{1}\right|=15$ and $\left|A_{3}\right|=14$, the number of such subsets $\{a, b\}$ is $14 \times 15=210$.
Case 3:a+1 and $b+1$ are contained in $A_{3}$ and $A_{5}$ respectively, but not in the same set.
Then $a$ and $b$ are contained in $A_{2}$ and $A_{4}$ respectively, but not in the same set. Note that $\left|A_{2}\right|=15$ and $\left|A_{4}\right|=14$. Thus the number of such subsets $\{a, b\}$ is $14 \times$ $15=210$.
Hence the answer is $182+2 \times 210=602$.