Thursday, June 2, 2011

Summer Problem Solving Marathon Solution #3

From a + d = b + c, we have a = b + c - d. We substitute this for a in bc - ad = 93 to get:

bc - (b + c - d)d = 93

or:

bc - bd - cd + d2 = 93

Rearranging terms, we get:

bc - cd + d2 - bd = 93

Factoring out c from the first two terms and d from the second two terms, we have:

c(b - d) + d(d - b) = 93

or:

d(d - b) - c(d - b) = 93

Then factoring out d - b, we have:

(d - c)(d - b) = 93

Now d - b and d - c must be integers, and d - b > d - c (since c > b). Since 93 = 3 * 31, there are two possibilities:

#1: d - b = 93, d - c = 1.
#2: d - b = 31, d - c = 3.

On the first possibility, b = d - 93, and c = d - 1. Since a = b + c - d, we have a = d - 93 + d - 1 - d = d - 94.

Since d < 500, the greatest possible value for d is 499. Since a = d - 94 > 0, the smallest possible value for d is 95. Once we pick d, the values of a, b, and c are fixed. There are 499 - 95 + 1 = 405 possible ordered 4-tuples under this possibility.

On the second possibility, b = d - 31 and c = d - 3. So a = b + c - d = d - 31 + d - 3 - d = d - 34.

So d is at most 499 as before, and at smallest 35 (so that a is at least 1). So there are 499 - 35 + 1 = 465 possible value for d on this possibility, and hence 465 possible ordered 4-tuples.

So between the two possibilities, there are 405 + 465 = 870 possible ordered 4-tuples meeting the conditions.