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

Ian Kelly ian.g.kelly at gmail.com
Mon Aug 16 17:04:29 CEST 2010

On Mon, Aug 16, 2010 at 4:23 AM, Roald de Vries <downaold at gmail.com> wrote:
>> I suspect that there exists a largest unpurchasable quantity iff at
>> least two of the pack quantities are relatively prime, but I have made
>> no attempt to prove this.
> That for sure is not correct; packs of 2, 4 and 7 do have a largest
> unpurchasable quantity.

2 and 7 are relatively prime, so this example fits my hypothesis.

> I'm pretty sure that if there's no common divisor for all three (or more)
> packages (except one), there is a largest unpurchasable quantity. That is: ∀
> i>1: ¬(i|a) ∨ ¬(i|b) ∨ ¬(i|c), where ¬(x|y) means "x is no divider of y"

No.  If you take the (2,4,7) example and add another pack size of 14,
it does not cause quantities that were previously purchasable to
become unpurchasable.


More information about the Python-list mailing list