The largest unmakeable total

A vending machine accepts only two chip denominations, worth 4 and 7 credits, and you may use any number of each (including none). Many totals - like 5 or 17 - cannot be paid exactly. What is the largest total (in credits) that cannot be formed as a non-negative combination of 4s and 7s?

Show hints (2)+
  1. Sort totals by their residue mod 4; within a class, adding 4s covers everything above the entry point.
  2. The entry point of each class is set by how many 7s you need to reach that residue.

Answer

Reveal answer →

17

Create a free account to see the full worked solution and track your progress.

Interview format: Market Maker, Numerical Reasoning Tests

Related questions