Hey all,
First of all, this isn't for homework, it's just b/c I'm curious. I was doing a math contest the other day, and one of the problems went something like this:
Given x and y, and n are non-negative integers. 9x+16y=n. Find the largest value of n that cannot be expressed in the form 9x+16y.
I didn't know a smart way to do it...so I guess and checked. However, it turns out there's a formula for this kind of stuff: the largest n that cannot be expressed by Ax+By is:
AB - (A+B)
So...I was wondering why this is/where the formula came from. Can anyone help me prove it..?
Thanks,
-Eric
edit1million: Thanks b0mbrman for pointing out a problem...I'm going to say that we will exclude the case where A is divisible by B (or vice versa). B/c in that case, n is the set of all numbers not divisible by A (or B), which has no largest value.
First of all, this isn't for homework, it's just b/c I'm curious. I was doing a math contest the other day, and one of the problems went something like this:
Given x and y, and n are non-negative integers. 9x+16y=n. Find the largest value of n that cannot be expressed in the form 9x+16y.
I didn't know a smart way to do it...so I guess and checked. However, it turns out there's a formula for this kind of stuff: the largest n that cannot be expressed by Ax+By is:
AB - (A+B)
So...I was wondering why this is/where the formula came from. Can anyone help me prove it..?
Thanks,
-Eric
edit1million: Thanks b0mbrman for pointing out a problem...I'm going to say that we will exclude the case where A is divisible by B (or vice versa). B/c in that case, n is the set of all numbers not divisible by A (or B), which has no largest value.