Patterns in solutions to $a^2 + b^2 + c^2 = n$

There is no clustering of the solutions of $a^2+b^2+c^2=n$, even for individual $n$'s, assuming the number of solutions is large (e.g. when $n\equiv 1,2,3,5,6\pmod{8}$ and $n$ is large). This was proved by William Duke (Invent. Math. 92 (1988), 73-90), his paper is available (for free) here.

For more recent results, e.g. what happens beyond equidistribution, see the work of Bourgain-Sarnak-Rudnick here and here.


There is a $48$-element symmetry group of the space of solutions. This by itself will create the appearance of the patterns when the number of solutions divided by $48$ is small. Imagine choosing $k$ random points in the fundamental domain $a \geq b \geq c \geq 0$ and reflecting them around the sphere. Patterns will appear, simply because it is unlikely for the $k$ points to be uniform in the triangle, and any nonuniformities will be magnified by some or all of the symmetries.

In your case $k \approx 2 \pi (12000)^{1/2} / 48 \approx 14$ is pretty small, and this might partially or entirely explain all the effect you see.