The banker can give $23 by giving two $7s and one $9, but he can't make $22 with any combination of 7s and 9s.
-
multiples of 7 & 9 are obviously taken care of
now a # not evenly divided by 7 can only leave remainders 1,2,... 6
remainder 2: 16 onwards taken care of (add 9 to multiples of 7)
remainder 4: 25 onwards taken care of (add 18 to multiples of 7, etc)
remainder 6: 34 onwards taken care of
remainder 1: 43 onwards taken care of
remainder 3: 52 onwards taken care of, 38 & below left out
remainder 5: 61 onwards taken care of, 47 & below left out
so the largest sum that can't be made is 47 <--------
now a # not evenly divided by 7 can only leave remainders 1,2,... 6
remainder 2: 16 onwards taken care of (add 9 to multiples of 7)
remainder 4: 25 onwards taken care of (add 18 to multiples of 7, etc)
remainder 6: 34 onwards taken care of
remainder 1: 43 onwards taken care of
remainder 3: 52 onwards taken care of, 38 & below left out
remainder 5: 61 onwards taken care of, 47 & below left out
so the largest sum that can't be made is 47 <--------