I have a sphere has equation $$(x-2)^2+(y-4)^2+(z-6)^2 = 225.$$ Now I want to count all squares on this sphere with the following condition: All vertices of four point are 12 different integeral numbers, for example, the square: $A(-12, -1, 4)$, $B(-9, 14, 8)$, $C(0, 9, 20)$ and $D(-3, -6, 16)$. How many squares satifying the above conditions?
I tried. From the equation $$(x-2)^2+(y-4)^2+(z-6)^2 = 225,$$ we have $$(x-2)^2 \leqslant 225 \Leftrightarrow -13 \leqslant x \leqslant 17,$$ $$(y-2)^2 \leqslant 225 \Leftrightarrow -11 \leqslant y \leqslant 19,$$ $$(z-6)^2 \leqslant 225 \Leftrightarrow -9 \leqslant z \leqslant 21.$$ Now, I can't solve my problem.
First I would find the solutions to $a^2+b^2+c^2=225$, which are only $(15,0,0), (12,9,0), (10,10,5),(14,5,2), (11,10,2)$, variations with negative signs, and their permutations. Now make a list of points that are on your sphere by adding each of these to your center point. Take one of the points of each flavor (base solution) and compute the distances to all the other points. If two distances are equal, you have a candidate square. Compute the fourth point and see if you have a square. You now have a list of squares that include each flavor. Rotate them around the sphere. A spreadsheet can help organize the computations.