looping through possible combinations of McNuggets packs of 6, 9 and 20

Giacomo Boffi giacomo.boffi at polimi.it
Mon Aug 16 21:57:59 CEST 2010


Baba <raoulbia at gmail.com> writes:

> Hi Mel,
>
> indeed i thought of generalising the theorem as follows:
> If it is possible to buy n, n+1,~, n+(x-1) sets of McNuggets, for some
> x, then it is possible to buy any number of McNuggets >= x, given that
> McNuggets come in x, y and z packs.
>
> so with diophantine_nuggets(7,10,21) i would need 7 passes
> result:53
>
> but with (10,20,30) and 10 passes i get no result

you need at least an odd number in your set, because summing even
numbers only you'll never get an odd result



More information about the Python-list mailing list