I think this can be expressed as:

`return zeros((counts + arange(len(counts))).sum(), dtype=int)`