James Propp wrote
(Is there software that makes problems like this easy to play with? If I had to write the code myself it'd take me days to do, and there's a good chance that my code would have mistakes that I'd miss.)
You might want to get in touch with any of the 'packomania' contributors. Their software (plural) might be overkill, as they're optimising rather than just greedily rule-following. David Cantrell's code is Mathematica-based (I was tempted to say "alas", but I hear some people like that platform). I'm surprised he's not on this list; he deserves to be, he's one of the few worthwhile contributors to sci.math nowadays. Phil -- () ASCII ribbon campaign () Hopeless ribbon campaign /\ against HTML mail /\ against gratuitous bloodshed [stolen with permission from Daniel B. Cristofani]