number of occurrences of each digit within a given range