A bag contains $n$ red and $k$ white balls. We draw two balls without replacement. For what values of $n$ and $k$ will the probability of drawing two balls of the same color be equal to the probability of drawing two balls of different colors?
If $n+k \leq 1$, that is, there is at most one ball, then both events are impossible, and the probabilities in question are thus 0. For the rest of the discussion, let us assume that $n+k \geq 2$.

Let $U$ denote the event that the drawn balls are of the same color, and $K$ the event that they are of different colors. Any two balls being drawn is equally likely, so to write down the probabilities of events $U$ and $K$, we need to determine the number of pairs where the two balls are of the same color, and the number of pairs where they are of different colors. The desired probabilities are then obtained by dividing these numbers by the total number of pairs that can be chosen, $\binom{n+k}{2}$.

The event $U$ can occur in two mutually exclusive ways; either both drawn balls are white - this is possible in $n(n-1) / 2$ ways - or both are red - there are $k(k-1) / 2$ such pairs. (Note that these formulas also give the correct - zero - result if $n$ or $k$ is less than 2.)

The event $K$ can occur in $n \cdot k$ ways, since for each of the $n$ white balls, any of the $k$ red balls can be chosen.

We are looking for the non-negative integers $n, k$ for which

$$
P(U)=\left[\frac{n(n-1)}{2}+\frac{k(k-1)}{2}\right] /\binom{n+k}{2}=n \cdot k /\binom{n+k}{2}=P(K)
$$

After rearrangement, we get that (1) holds exactly when $(n-k)^{2}=n+k$. Introducing the notation $n-k=t$, we have $n+k=t^{2}$, from which

$$
k=\frac{(t-1) \cdot t}{2} \quad \text { and } \quad n=\frac{t \cdot(t+1)}{2}
$$

These quantities are non-negative integers for all integer values of $t$, and since the steps are reversible for $|t|>1$, (1) holds for the $(k, n)$ pairs calculated according to (2) - in this case, both probabilities are $1 / 2$.

In summary, then: the set of $(k, n)$ pairs in question is the set $\left\{\frac{t^{2}-t}{2}, \frac{t^{2}+t}{2} ; t\right.$ is an integer $\}$, or in other words, any two consecutive elements of the following sequence can be $n$ and $k$, or $k$ and $n$:

$$
0,1,3,6, \ldots, \frac{m(m-1)}{2}, \ldots
$$