4 kill "lcmrefl.txt"
5 open "lcmrefl.txt" for output as #2
10 for X=1 to 1000
20 for Y=1 to 1000
30 if lcm(X,Y)=1000 then
40 :for Z=1 to 2000
50 :if lcm(X,Z)=2000 then
60 :if lcm(Y,Z)=2000 then inc Ct:print #2,X,Y,Z:endif:endif
65 :next
70 next
80 next
90 print Ct:close
finds 70 triplets:
x y z
1 1000 2000
2 1000 2000
4 1000 2000
5 1000 2000
8 125 2000
8 250 2000
8 500 2000
8 1000 2000
10 1000 2000
20 1000 2000
25 1000 2000
40 125 2000
40 250 2000
40 500 2000
40 1000 2000
50 1000 2000
100 1000 2000
125 8 2000
125 40 2000
125 200 2000
125 1000 16
125 1000 80
125 1000 400
125 1000 2000
200 125 2000
200 250 2000
200 500 2000
200 1000 2000
250 8 2000
250 40 2000
250 200 2000
250 1000 16
250 1000 80
250 1000 400
250 1000 2000
500 8 2000
500 40 2000
500 200 2000
500 1000 16
500 1000 80
500 1000 400
500 1000 2000
1000 1 2000
1000 2 2000
1000 4 2000
1000 5 2000
1000 8 2000
1000 10 2000
1000 20 2000
1000 25 2000
1000 40 2000
1000 50 2000
1000 100 2000
1000 125 16
1000 125 80
1000 125 400
1000 125 2000
1000 200 2000
1000 250 16
1000 250 80
1000 250 400
1000 250 2000
1000 500 16
1000 500 80
1000 500 400
1000 500 2000
1000 1000 16
1000 1000 80
1000 1000 400
1000 1000 2000
Due to the symmetry of x and y, you might want to know only those cases where y>=x. There are 37:
1 1000 2000
2 1000 2000
4 1000 2000
5 1000 2000
8 125 2000
8 250 2000
8 500 2000
8 1000 2000
10 1000 2000
20 1000 2000
25 1000 2000
40 125 2000
40 250 2000
40 500 2000
40 1000 2000
50 1000 2000
100 1000 2000
125 200 2000
125 1000 16
125 1000 80
125 1000 400
125 1000 2000
200 250 2000
200 500 2000
200 1000 2000
250 1000 16
250 1000 80
250 1000 400
250 1000 2000
500 1000 16
500 1000 80
500 1000 400
500 1000 2000
1000 1000 16
1000 1000 80
1000 1000 400
1000 1000 2000
from:
4 kill "lcmrefl.txt"
5 open "lcmrefl.txt" for output as #2
10 for X=1 to 1000
20 for Y=X to 1000
30 if lcm(X,Y)=1000 then
40 :for Z=1 to 2000
50 :if lcm(X,Z)=2000 then
60 :if lcm(Y,Z)=2000 then inc Ct:print #2,X,Y,Z:endif:endif
65 :next
70 next
80 next
90 print Ct:close
|
Posted by Charlie
on 2014-02-14 11:47:49 |