# Reduce the time to find six integer numbers so that the angle of two vectors equal to Pi/6

I am trying to find six integer numbers a, b, c, x, y, z so that the angle of two vector {a, b, c and {x, y, z} equal to Pi/6. I tried

Clear[a, b, c]
u = {x, y, z};
v = {a, b, c};
list = {u, v} /.
Solve[{4*(a*x + b*y + c*z)^2 ==
3*(a^2 + b^2 + c^2)*(x^2 + y^2 + z^2), a b c x y z != 0, a > x,
0 < a*x + b*y + c*z, GCD[a, b, c] == 1, GCD[x, y, z] == 1,
Sequence @@ Thread[0 < {a, b, c, x, y, z} < 15]}, {x, y, z, a, b,
c}, Integers];
Select[list, (6 == Length[Union @@ #] &)]


If I use

Sequence @@ Thread[0 < {a, b, c, x, y, z} < 9]}


I got

{{{1, 2, 7}, {4, 3, 5}}, {{1, 3, 4}, {5, 2, 7}}, {{1, 4, 3}, {5, 7, 2}}, {{1, 7, 2}, {4, 5, 3}}, {{1, 7, 8}, {3, 2, 5}}, {{1, 8, 7}, {3, 5, 2}}, {{2, 1, 7}, {3, 4, 5}}, {{2, 3, 5}, {7, 1, 8}}, {{2, 5, 3}, {7, 8, 1}}, {{2, 5, 7}, {3, 1, 4}}, {{2, 7, 1}, {3, 5, 4}}, {{2, 7, 5}, {3, 4, 1}}, {{4, 1, 3}, {7, 5, 2}}, {{4, 3, 1}, {7, 2, 5}}, {{5, 2, 3}, {8, 7, 1}}, {{5, 3, 2}, {8, 1, 7}}, {{5, 3, 4}, {7, 2, 1}}, {{5, 4, 3}, {7, 1, 2}}}

The time is longer If I use

Sequence @@ Thread[0 < {a, b, c, x, y, z} < 15]}


How can I reduce timing?

• Your results have an angle of Pi/6 not Pi/3. You should use 2 and 1 as coefficients rather than 4 and 3. – Daniel Huber Mar 12 at 11:46
• Thank you very much. – minhthien_2016 Mar 12 at 11:53
• @DanielHuber I think 4 and 1 as coefficients rather than 4 and 3 (if angle of Pi/3). – minhthien_2016 Mar 12 at 12:32
• Yes, you are right it of Cos[]^2 not Cos[] – Daniel Huber Mar 12 at 12:44

n = 10;