looping through possible combinations of McNuggets packs of 6, 9 and 20
News123
news1234 at free.fr
Wed Aug 18 07:20:49 EDT 2010
On 08/17/2010 11:44 PM, Baba wrote:
> On Aug 16, 6:28 pm, "cbr... at cbrownsystems.com"
> <cbr... at cbrownsystems.com> wrote:
>
>> First, suppose d = gcd(x, y, z); then for some x', y', z' we have that
>> x = d*x', y = d*y', z = d*z'; and so for any a, b, c:
>>
>
>
> could you explain the notation?
>
> what is the difference btw x and x' ?
>
> what is x = d*x', y supposed to say?
>
>
gcd(x,y,z) determines the greates number by which all three numbers can
be devided.
2,4,6 for example are all divided by 2
thus d=2
now you dived x,y,z by d and call them x' , y' , z'
The point is if
x,y,z have a gcd grater than one, then you know for sure,
that you will never be able to find the a finit greates amount, which
cannot be bought
if xmymz are all divisible by d, then any combination will also be
dividible by d
thas any number not dividible by d ( for d > 1)
for example n*d + 1
can not be bought
More information about the Python-list
mailing list