Counting sort initialization of the output array, each take time. Therefore, the time for the whole algorithm is the sum of the times for these steps, . Because it uses arrays of length and , the total space usage of the algorithm is also . For problem instances in which the maximum key value is significantly smaller than the number of items, counting sort can be highly space-efficient, as the only storage it uses other than its input and output arrays is the Count array which uses space . If each item to be sorted is itself an integer, and used as
Integer triangle 2"n" − 3. Thus there is no integer triangle with perimeter 1, 2 or 4, one with perimeter 3, 5, 6 or 8, and two with perimeter 7 or 10. The sequence of the number of integer triangles with perimeter "p", starting at "p" = 1, is: The number of integer triangles (up to congruence) with given largest side "c" and integer triple ("a", "b", "c") is the number of integer triples such that "a" + "b" > "c" and "a" ≤ "b" ≤ "c". This is the integer value Ceiling[] * Floor[]. Alternatively, for "c" even it is the