in reply to How to restrict partitions
Hmm, for small numbers, you can certainly afford to use Integer::Partition and filter out combinations that do not fit your needs, but if your numbers grow only slightly larger, then your program is going to do really a lot of unnecessary work and very quickly become unusable. I do not know if any module is able to do that, but I strongly suspect that you might need to write your own algorithm if you want to process any number with more than 2 digits, perhaps even with smaller numbers.
|