Baba wrote: > Hi All, > > @Emile tnx for spotting the mistake. Should have seen it myself. > > @John & Ian i had a look around but couldn't find a general version of > below theorem > If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x, > then it is possible to buy any number of McNuggets >= x, given that > McNuggets come in 6, 9 and 20 packs.
Not that hard. When you can buy nuggets `n` to a pack (6 for example) then if you have schemes for buying k,k+1,k+2,...,k+n-1 nuggets, you can create a scheme for buying any number of nuggets >= k . At worst just buy packs of `n` until the number left to buy is between k and k+n-1 inclusive, then follow the scheme for that number. Mel. -- http://mail.python.org/mailman/listinfo/python-list