xinyu04

导航

MathProblem 9 Chicken McNugget problem

At McDonalds you can order Chicken McNuggets in boxes of \(6\), \(9\), and \(20\). What is the largest number such that you can not order any combination of the above to achieve exactly the number you want?

Solution

找出最大不能覆盖的数。考虑:

\[\begin{align} x &=6a+9b+20c\\ &= 3(2a+3b)+20c\\ &= 3k+20c \end{align} \]

可以发现 \(k=2,3,...\) 即第一项可以取到除了 \(3\) 以外的所有三的倍数。第二项是 \(20\) 的倍数,为了求出最大不能取到的数,\(\max{c} = 2\). 因为当 \(c\ge 3\) 时,我们总可以通过因式分解得到:

\[3k+20c=3k+20(c-3 +3) = 3(k+20)+20(c-3) \]

因此最大不能取到的数为 \(20*2+3 = 43\)

posted on 2022-07-30 05:04  Blackzxy  阅读(45)  评论(0编辑  收藏  举报