The underlying idea is to be able to use it in aggregators "Group by" to let you easily group bundles in x amount of bundles.
It seems fairly easy to implement as it's hard to believe that this data isnt lying around internally.
The below solution is presented as a showcase on make community. So the simple fact that you bothered posting it means a number of people need this, but the complexity of this solution is absolutely dumb and unacceptable for such a basic need: