clc
max=300;
for a=-1:2:1
for b=-1:2:1
for x=1:max
for y=1:max
g1=gcd(x,y);
if (1-a/x-2*b/y) ~=0
z0=3/(1-a/x-2*b/y);
for z=floor(z0):ceil(z0)
if z~=0
g=gcd(g1,abs(z));
if a*g/x+2*b*g/y+3*g/z==g
disp([a*x b*y z])
end
end
end
end
end
end
fprintf('\n')
end
end
If both x and y are negative:
x y z
-1 -2 1
-3 -12 2
-4 -8 2
-6 -6 2
-10 -5 2
If x is negative and y is positive, the list could go on forever, limited here by the 300 limit imposed by the program:
-1 2 3
-1 4 2
-2 1 -6
-2 2 6
-2 4 3
-3 2 9
-3 6 3
-4 1 -4
-4 2 12
-4 4 4
-4 8 3
-5 2 15
-5 10 3
-6 2 18
-6 3 6
-6 12 3
-7 2 21
-7 14 3
-8 2 24
-8 16 3
-9 2 27
-9 18 3
-10 2 30
-10 4 5
-10 20 3
-11 2 33
-11 22 3
-12 2 36
-12 6 4
-12 24 3
-13 2 39
-13 26 3
. . .
-144 2 432
-144 288 3
-145 2 435
-145 290 3
-146 2 438
-146 292 3
-147 2 441
-147 294 3
-148 2 444
-148 296 3
-149 2 447
-149 298 3
-150 2 450
-150 300 3
-151 2 453
-152 2 456
-153 2 459
-154 2 462
-155 2 465
-156 2 468
-157 2 471
-158 2 474
-159 2 477
-160 2 480
-161 2 483
-162 2 486
-163 2 489
-164 2 492
-165 2 495
. . .
-289 2 867
-290 2 870
-291 2 873
-292 2 876
-293 2 879
-294 2 882
-295 2 885
-296 2 888
-297 2 891
-298 2 894
-299 2 897
-300 2 900
Likewise with x positive and y negative:
1 -2 3
1 -4 6
1 -6 9
1 -8 12
1 -10 15
1 -12 18
1 -14 21
1 -16 24
1 -18 27
1 -20 30
1 -22 33
1 -24 36
1 -26 39
. . .
1 -286 429
1 -288 432
1 -290 435
1 -292 438
1 -294 441
1 -296 444
1 -298 447
1 -300 450
2 -2 2
2 -4 3
2 -8 4
2 -20 5
3 -6 3
3 -24 4
4 -8 3
5 -10 3
6 -3 2
6 -12 3
7 -14 3
8 -16 3
9 -18 3
10 -20 3
11 -22 3
12 -24 3
13 -26 3
14 -28 3
. . .
144 -288 3
145 -290 3
146 -292 3
147 -294 3
148 -296 3
149 -298 3
150 -300 3
With x and y positive:
Note, only negative z values have fallen into the ellipses that prevent the list from being too large. The list with only positive x, y and z seems to be finite.
1 2 -3
1 4 -6
1 6 -9
1 8 -12
1 10 -15
. . .
1 266 -399
1 272 -408
1 274 -411
1 276 -414
1 278 -417
1 280 -420
1 284 -426
1 286 -429
1 288 -432
1 290 -435
1 292 -438
1 294 -441
1 296 -444
1 298 -447
2 1 -2
2 2 -6
2 5 30
2 7 14
2 8 12
2 10 10
2 12 9
2 16 8
2 28 7
3 2 -9
3 6 9
3 12 6
3 30 5
4 2 -12
4 3 36
4 4 12
4 8 6
5 2 -15
5 4 10
5 10 5
5 40 4
6 2 -18
6 3 18
6 4 9
6 6 6
6 24 4
7 2 -21
8 2 -24
8 4 8
8 16 4
9 2 -27
10 2 -30
10 5 6
12 3 12
12 12 4
13 2 -39
14 2 -42
14 4 7
15 2 -45
15 6 5
16 2 -48
17 2 -51
18 2 -54
19 2 -57
20 2 -60
20 10 4
21 2 -63
22 2 -66
23 2 -69
24 2 -72
25 2 -75
26 2 -78
27 2 -81
28 2 -84
29 2 -87
30 2 -90
30 3 10
31 2 -93
32 2 -96
33 2 -99
36 9 4
37 2 -111
38 2 -114
41 2 -123
43 2 -129
44 2 -132
46 2 -138
. . .
288 2 -864
289 2 -867
291 2 -873
293 2 -879
295 2 -885
297 2 -891
298 2 -894
299 2 -897
300 2 -900
Separated out, the solutions with all of x, y and z positive are:
2 5 30
2 7 14
2 8 12
2 10 10
2 12 9
2 16 8
2 28 7
3 6 9
3 12 6
3 30 5
4 3 36
4 4 12
4 8 6
5 4 10
5 10 5
5 40 4
6 3 18
6 4 9
6 6 6
6 24 4
8 4 8
8 16 4
10 5 6
12 3 12
12 12 4
14 4 7
15 6 5
20 10 4
30 3 10
36 9 4
|
Posted by Charlie
on 2021-02-28 09:41:41 |