I developing a simple algorithm and would like to know how I can use formulas to find a number of combinations of two in a row of digits.
For example:
The row of digits: 0, 1, 2;
Possible combinations are: (0, 1), (0, 2), (1, 2)
The number of combinations is: 3
The row of digits: 0, 1, 2, 3
Possible combinations are: (0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2,3)
The number of combinations is: 6
How do I find a number of unique combinations knowing the number of digits in the row?