I am using a multiple variable summation formula, but I cannot seem to render it in mathematical text.
The principle is as follows: You have five hundred thousand units, they can be stored in any sized allotments, so in theory you could have five hundred thousand allotments (easy) to fifty allotments of variable potential sizes. The number of allotments is a Rand function, and the size of each allotment is a Rand function where they add up to the total units precisely.