Brute force computation works, with the following trick.
The square root expression for the distance $d$ between $(x_1, x_2, x_3), (y_1, y_2, y_3)$ is equivalent to
$$
d^2 = (x_1 - y_1)^2 + (x_2 - y_2)^2 + (x_3 - y_3)^2
$$
Each term on the RHS is a perfect square and is bounded by $256^2$. There are $256$ perfect squares less than $256^2$ (including $0$). We can trivially enumerate them. For each pair $(x,y), 0 \le x,y \le 255$ we can compute $(x-y)^2$ and build a frequency table $T$ containing entries $\langle (x-y)^2, \nu_{(x-y)^2}\rangle$ where $\nu_{(x-y)^2}$ is the frequency of $(x-y)^2$. We treat this table as a set and identify the entries in it by the pair $(s,\nu)$.
For each triple $((s_1, \nu_1), (s_2, \nu_2), (s_3, \nu_3)) \in T \times T \times T$, we compute the pair
$$
(s,\nu) = (s_1 + s_2 + s_3, \nu_1 \nu_2 \nu_3)
$$
Call this result set $U$.
$U$ gives the distribution of the squares $s = d^2 \lt 256^2$. We should aggregate the frequency by $s$.
i.e.,
$$V = \{(s, \nu) : \nu = \sum_{(s^{\prime}, \nu^{\prime}) \in U} \nu^{\prime} \text{ where $s^{\prime} = s$ }\}$$
Since we are interested in the distribution of $d$, the positive square root of $d^2$ only, we use the same aggregate frequency. i.e., the map
$$
(s, \nu) \rightarrow (\sqrt{s}, \nu)
$$
The following C# program implements the above:
public class Program
{
public static IEnumerable<long> DiffOfSquares()
{
const int limit = 256;
for(int i = 0; i < limit; i++)
{
for(int j = 0; j < limit; j++) {
yield return (i - j)*(i - j);
}
}
}
public static IEnumerable<(long dsquared, long count)> SumOf3DiffOfSquares()
{
var q =
from dos in DiffOfSquares()
group dos by dos into g
select (dos: g.Key, count: g.Count());
var diffOfSquares = q.ToArray();
foreach(var t1 in diffOfSquares) {
foreach(var t2 in diffOfSquares) {
foreach(var t3 in diffOfSquares)
{
yield return (
dsquared: t1.dos + t2.dos + t3.dos,
count: t1.count * t2.count * t3.count
);
}
}
}
}
public static void Calculate()
{
var q =
from entry in SumOf3DiffOfSquares()
group entry by entry.dsquared into g
select (
dsquared: g.Key,
count: g.Select(x => x.count).Sum()
);
foreach(var entry in q)
{
Console.WriteLine(entry);
}
}
public static void Main(string[] args)
{
Calculate();
}
}