The chicken nugget problem
Asked at Jane Street, SIG
A fast-food restaurant sells chicken nuggets only in boxes of 6, 9, and 20. By buying some combination of boxes, you can obtain various total nugget counts, for example , but you cannot buy exactly .
What is the largest number of nuggets that you can NOT purchase exactly?
Show a hint
Once you can make some run of 6 consecutive totals, you can make everything above it (just add 6-boxes). Search upward for the first such run.