Jai alai balls come in boxes of 8 and 15, so that 38 balls (one small box and two large boxes) can be purchased without having to break open a box, but 37 balls cannot. Find the maximum number of balls that cannot be bought without breaking boxes.
Okay - this has to do with modulo arithmetic. The upper bound on this will be (8-1)*15 = 105, since after 7*15 you can get any number mod 15 by choosing (0 to 7) 15-boxes + as many 8-boxes as you need. (Since 15 and 8 are relatively prime, 15n is guaranteed to get every value mod 8.)
There should be one value between 6*15 and 7*15 that doesn't work, and that should be the number that has the same value mod 8 as 7*15 mod 8. So the answer will be 7*15 - 8 = 97.
Checking:
8 does not go into 97 or 97 - (2n * 15)
8 does not go into 97-15 = 82
8 does not go into 97-45 = 52
8 does not go into 97-75 = 22
Now, looking at the next values:
98 = 15*6 + 8
99 = 15*5 + 8*3
100 = 15*4 + 8*5
101 = 15*3 + 8*7
102 = 15*2 + 8*9
103 = 15 + 8*11
104 = 8*13
105 = 15*7
Any larger numbers can be made by adding boxes of 8 to the numbers above.