A certain chain store sells chocolate bars in packets of 17 and 9 only.
Clearly, you could not get 8 or 25 bars.
Find all quantities of bars that you cannot buy.
Generalize for m and n, mutually prime integers, m>n.
(In reply to Start of a General Solution
ok, just show that above a certain number N any given quantity is representable in terms of m and n.
e.g. if there were only 5 and 3 dollar bills then 7 is the highest amount that cannot be paid: 5+3, 3+3+3, 5+5 and so on by adding 3's only.
JUST GENERALIZE FOR m AND n.