http://www.perlmonks.org?node_id=407023


in reply to Re: How to generate restricted partitions of an integer
in thread How to generate restricted partitions of an integer

This will miss many conversions such as 10 => 2 2 2 2 2 (not catered for by %subs) and 20 => 5 5 5 5 (not catered for by the single iterative substitution approach).

Hugo

Replies are listed 'Best First'.
Re^3: How to generate restricted partitions of an integer
by thor (Priest) on Nov 11, 2004 at 13:23 UTC
    But...there isn't a 2 euro note, per the original OP (I wouldn't know...I'm a dumb American). The breaking of a 20 into 4 5's is valid, though.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

Re^3: How to generate restricted partitions of an integer
by BrowserUk (Patriarch) on Nov 11, 2004 at 13:24 UTC

    Agreed. It's an idea that needs some work.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon