Question:  N:=10:L:=[]:for x1 to N dofor

This question is related to the Question Perimeter of a triangle

 

N:=10:

L:=[]:

for x1 to N do

for y1 from x1 to N do

for z1 from y1 to N do

for x2 to N do

for y2 to N do

for z2 to N do

a:=sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2):

if type(a, positive) and type(sqrt(x1^2+y1^2+z1^2)+ sqrt(x2^2+y2^2+z2^2)+a, integer) then L:=[op(L), {[0, 0, 0], [x1, y1, z1], [x2, y2, z2]}]: fi:

od: od: od: od: od: od:

nops(L);

L;

 

In the above code,  there are some three points o, A(x1, y1, z1), B(x2,y2,z2)  lies on a line. How can I omit them? Thank you.

Please Wait...