21. Among the 100 integers from $1 \sim 100$, arbitrarily select three different numbers to form an ordered triplet $(x, y, z)$. Find the number of triplets that satisfy the equation $x+y=3z+10$.
(1) When $3 z+10 \leqslant 101$, i.e., $z \leqslant 30$, the number of ternary tuples satisfying $x+y=3 z+10$ is
$$
S=\sum_{k=1}^{30}(3 k+9)=1665 \text{. }
$$
(2) When $3 z+10 \geqslant 102$, i.e., $31 \leqslant z \leqslant 63$, the number of ternary tuples satisfying $x+y=3 z+10$ is
$$
\begin{aligned}
T & =\sum_{k=31}^{63}(191-3 k) \\
& =\sum_{k=1}^{33}[191-3(k+30)]=1650 .
\end{aligned}
$$

Now consider the case where $x, y, z$ are equal.
First, $x, y, z$ cannot all be equal.
If $x=y$, then the number of ternary tuples satisfying $x+y=3 z+10$ is $A=31$.

If $x=z$, then the number of ternary tuples satisfying $x+y=3 z+10$ is $B=45$.

If $y=z$, then the number of ternary tuples satisfying $x+y=3 z+10$ is $C=45$.
In summary, the number of ternary tuples is
$$
S+T-A-B-C=3194 .
$$