Find all positive integers X and Y such that:
- X divides Y+5, and:
- Y divides X+3
Prove that there are no others.
OPEN "int div dilemma.txt" FOR OUTPUT AS #2
FOR tot = 2 TO 9999
FOR x = 1 TO tot - 1
y = tot - x
IF (y + 5) MOD x = 0 AND (x + 3) MOD y = 0 THEN
PRINT x, y
PRINT #2, x, y
END IF
NEXT
NEXT
close
finds only
x y
1 1
1 2
2 1
3 1
1 4
2 5
6 1
7 2
4 7
9 4
8 11
13 8
|
Posted by Charlie
on 2014-04-10 11:58:58 |