TITLE: Find the number of $2$-element subsets $\{a,b\}$ of $\{1,\cdots,1000\}$ such that $5 \mid a\cdot b$
QUESTION [5 upvotes]: Well, I have thought of two different solutions giving contradictory results, obviously one of them is wrong, or maybe both are wrong, but I can't see why. Please help me find the logical flaws or counting mistakes in my arguments.
The first alleged solution:
Since $5$ is a prime number, then $5 \mid a$ or $5 \mid b$.  Without loss of generality, assume that $5 \mid a$. There are $200$ numbers in $\{1,\cdots,1000\}$ that are divisible by $5$. So, we have $200$ choices for $a$. On the other hand, the other number can be anything that we want, except $a$, because in that case the subset will be a singleton. So, we have $999$ choices for $b$. Therefore, there are $200 \times 999=199800$ such subsets.
The second alleged solution:
There are $200$ numbers that are divisible by $5$ in $\{1,\cdots,1000\}$. To find a $2$-element subset such that the product of its two elements is divisible by $5$ we can find the number of all $2$-element subsets such that the product of its elements is not divisible by $5$ and subtract this quantity from the number of $2$ element subsets of $\{1,\cdots,1000\}$:
$${1000 \choose 2} - {800 \choose 2} = \frac{1000(999)}{2} - \frac{800(799)}{2}=179900$$
Why these two numbers don't match? Aren't they supposed to be equal?!!

REPLY [3 votes]: Let $U = \{1,2,...,1000\}$, and $A = \{\{a,b\}: (a,b) \in U^2,5|a, 5\not|b\}$,   $B = \{\{a,b\}: (a,b) \in U^2, 5|a, 5|b\}$, and
$C = \{\{a,b\}: (a,b) \in U^2, 5|ab\}$. Then:
$C = A\cup B$, and $A$, $B$ are disjoint. Thus:
$|C| = |A| + |B| = \binom{200}{1}\cdot \binom{800}{1}+ \binom{200}{2} = 179,900$.