The McNugget problem originally stated that: For three different sized boxes of 6, 9, & 20 nuggets, what is the greatest number of nuggets that can’t be ordered with these combinations? For example, if you want to order 22 nuggets, the seller may put 20 nuggets in the big box with 2 remained. They may try combining the 6 and 9 combinations, but they all end up with multiples of 3, which can’t divide 22. Now it may seem that such unreachable number will be infinite, but as a matter of fact, it is not because as the number gets larger, the modular arithmetic summation between these multiples will eventually involve all factors.
For example, if you order 101 nuggets, 101 = 99 + 2. Since 99 is a multiple of 3, we have to find the number that has a remainder of 2 when divided by 3. Well, 20 is a perfect candidate!
Thus, . That means the seller can provide you with 1 big box of 20 nuggets plus 9 boxes of 9 nuggets as your order.
This number is formally called Frobenius number written as G(a, b, c), the greatest number which can’t be written in the summation of multiples of positive integers a, b, & c: G will have no solutions for non-negative integers xi.
The modified Frobenius number
By using Johnson’s formula ,
Then if and , then , for some integers p, q, r, s.
By definition, , but since x3 can be any non-negative integer, G will always in the range from 0 to infinity. Therefore, the greatest integer, which can’t be written in non-negative summation is -1, the greatest negative integer. Hence,
Note that lcm is the largest common multiple: and . Thus, .
I called it: Dr. Warm’s Formula.
Now let’s back to our Mcnugget question: What is the value of ?
Then , and clearly 6 can divide 180. So let’s calculate with Dr. Warm’s formula:
As a result, the 43 nuggets are the largest amount that can’t be ordered as the combinations of boxes as mentioned above.
Dr. Warm's Formula
If and , then .