21. Among the 100 integers from , arbitrarily select three different numbers to form an ordered triplet . Find the number of triplets that satisfy the equation .
Problem 653
Official solution
(1) When , i.e., , the number of ternary tuples satisfying is
(2) When , i.e., , the number of ternary tuples satisfying is
Now consider the case where are equal.
First, cannot all be equal.
If , then the number of ternary tuples satisfying is .
If , then the number of ternary tuples satisfying is .
If , then the number of ternary tuples satisfying is .
In summary, the number of ternary tuples is