Consider we have some numbers for example $3,4,8$ that its mean is, $5$. It is easy to follow that, $$\left(3-4\right)^2+\left(4-8\right)^2+\left(3-8\right)^2 = 3\cdot\left( (3-5)^2+(4-5)^2+(8-5)^2 \right)$$. I thought and searched a lot for a proof but I didn't find anything. I would be appreciate if you can provide me a proof for this fact.
thank you
Let your numbers be $a_1,\dots,a_n$. Let their sum be $s$, so their mean is $m=s/n$.
We get $\sum_{i,j}(a_i-a_j)^2=(n-1)\sum a_i^2-2\sum_{i\ne j}a_ia_j=n\sum a_i^2-s^2$ and $\sum(a_i-m)^2=\sum a_i^2-2m\sum a_i+nm^2=\sum a_i^2-nm^2$. But $n\left(\sum a_i^2-nm^2\right)=n\sum a_i^2-s^2$, and we're done.