Choosing pairs of numbers with a sum-bound
I have the following question:
How can one write up a closed formula for computing the number of possible pairs of numbers in a set, whose sum is lees than or equal to a constraint?
For example: if we have the numbers from 1 to 100 what is the number of cases when the sum of the two numbers in a pair is less than 10. Here, the 1, 100 and 10 values are not important at all, I just wanted make it easier to demonstrate the problem. Of course, I would need a so called closed formula for that, I am not sure whether it exists. (Iterative solution is unfortunately not an option).
Any help would be appreciated!