13. In a drawer, there are red and blue socks, no more than 1991 in total. If two socks are drawn without replacement, the probability that they are the same color is $\frac{1}{2}$. How many red socks can there be at most in this case?
13. Let the number of red and black balls be $x$ and $y$ respectively. Given that the probability of randomly picking two balls of different colors is $\frac{1}{2}$, we have $\frac{x y}{C_{x+y}^{2}}=\frac{1}{2}$.
Therefore, $(x+y)(x+y-1)=4 x y$,

Thus, $(x-y)^{2}=x+y$.
Hence, the total number of balls is a perfect square. Let $n=x-y$, then
$$
\begin{array}{l}
n^{2}=x+y, \quad \therefore x=\frac{n^{2}+n}{2}, \\
\because x+y \leqslant 1991, \quad \therefore|n| \leqslant \sqrt{1991}<45 .
\end{array}
$$

When $n=44$, $x$ reaches its maximum value of 990.