Determine the total number of quadruplets (A,B, C, D) of positive integers with A ≤ B ≤ C ≤ D ≤ 25, such that (A+B)*(C+D) is divisible by A*D – B*C, whenever A*D ≠ B*C.
Note: x refers to the
absolute value of x.
DEFDBL AZ
FOR a = 1 TO 25
FOR b = a TO 25
FOR c = b TO 25
FOR d = c TO 25
num = (a + b) * (c + d)
den = ABS(a * d  b * c)
IF a * d = b * c THEN
PRINT TAB(40); a; b; c; d
ct0 = ct0 + 1
ELSE
IF num MOD den = 0 THEN
PRINT a; b; c; d
ct = ct + 1
END IF
END IF
NEXT
NEXT
NEXT
NEXT
PRINT ct, ct0
finds that 4271 sets satisfy all the criteria, while 462 sets have A*D = B*C. It could be said that all 4733 sets are such that whenever A*D not= B*C, (A+B)*(C+D) is divisible by A*D  B*C.
Edited on February 6, 2011, 5:37 pm
Edited on February 6, 2011, 5:39 pm

Posted by Charlie
on 20110206 17:36:56 