For my puzzle blog I am looking into finite sets $\{x_1, x_2, ... x_n\}$, with $x_i$ an integer, and for which both the average and the standard deviation are integers. There are lots of sets with $n=4$ (such as $\{7, 5, 5, -1\}$) and $n=5$ (such as $\{8, 8, 8, 3, -2\}$) but for $n=3$ I just found the trivial ones ($\{x_1, x_1, x_1\}$).
My question is: Do any non-trivial ones exist? If not, is there an elementary proof that such sets of three integer numbers don't exist?
I do understand that for any three number set $\{a,b, c\}$ to have an integer standard deviation, we have to look for the integer solutions of: $(a-m)^2 + (b-m)^2 + (c-m)^2 = 3n^2$, with $m=(a+b+c)/3$, but my knowledge of number theory is either too limited or too rusty to solve $6(a^2 + b^2 + c^2 -ab - bc -ca) = 27n^2$ which is equivalent to $$(a-b)^2+(b-c)^2+(c-a)^2=(3n)^2$$
Mind you, I don't need this to construct the puzzle for my blog - I can do that with the four and five number sets. It just struck me as curious that I didnt find any sets consisting of three numbers. I did write a short program in excel vba that tried all numbers, and I only could find sets like $\{3, 3, 3\}$ up to $346$, after which I had to break off the program.
There are not non-trivial solutions.
$$(a-m)^2 + (b-m)^2 + (c-m)^2 = 3n^2$$where $m=(a+b+c)/3$ is equivalent to $$(a-b)^2+(b-c)^2+(c-a)^2= (3n)^2\tag1$$
If $n=0$, then $a-b=b-c=c-a=0$ gives $a=b=c$.
In the following, $n$ is a positive integer. Letting $a-b=p_1,b-c=q_1,r=3n$, $(1)$ can be written as $$2p_1^2+2q_1^2+2p_1q_1=r^2$$ Since $r$ has to be even, letting $r=2^aN$ ($a$ is a positive integer and $N$ is odd) gives $$p_1^2+q_1^2+p_1q_1=2^{2a-1}N^2\tag2$$ Since both $p_1$ and $q_1$ have to be even, letting $p_1=2p_2,q_1=2q_2$ gives $$2p_2^2+2q_2^2+2p_2q_2=2^{2a-2}N^2$$ Dividing the both sides by $2$ gives $$p_2^2+q_2^2+p_2q_2=2^{2a-3}N^2\tag3$$
Comparing $(3)$ with $(2)$ and continuing this process, eventually, there exist integers $P,Q,N$ ($N$ is odd) such that $$2P^2+2Q^2+2PQ=N^2$$ The LHS is even while the RHS is odd, which is a contradiction.