6. A bag contains $m$ red balls and $n$ white balls, $m>n \geq 4$. Now, two balls are drawn at random. If the probability of drawing two balls of the same color is equal to the probability of drawing two balls of different colors, then the number of arrays $(m, n)$ that satisfy the relation $m+n \leq 40$ is $\qquad$ .