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
Kaprekar number Kaprekar numbers are named after D. R. Kaprekar. Let "X" be a non-negative integer and "n" a positive integer. "X" is an "n"-Kaprekar number for base "b" if there exist non-negative integer "A", and positive integer "B" satisfying: If "d" is any divisor of "n", then "X" is also a "d"-Kaprekar number for base "b". A Kaprekar number for base "b" is one which is an "n"-Kaprekar number for that base and some positive integer "n". More generally, we can define the set "K"("N") for a given integer "N" as the set of integers "X" for which An "n"-Kaprekar number