Consider the multivariate polynomial
$$f(x\_1,\ldots,x\_m)=mk\sum\_{i=1}^mx\_i^2-mk(k-1)\sum\_{i=1}^mx\_i-\left(\sum\_{i=1}^mx\_i\right)^2,$$
for integers $m,k\ge2$. We are looking for integral zeros of $f$ with $0\le x\_i\le k$. If $mk$ is square free, then it is easily seen that the only zeros of $f$ under the above conditions are $(0,\ldots,0)$ and $(k,\ldots,k)$. We believe that given $k$ if $m$ is large enough and $mk$ is divisible by square of an odd prime, then $f$ has more zeros. Could somebody provide a proof?



Integral zeros of a multivariate polynomial
First, I will consider the case of $k\geq 4$.


Let $mk=aq^2$, where $q$ is an odd prime.
Since $f(x\_1,\dots,x\_m)=0$ implies that $mk$ divides $(\sum x\_i)^2$, we will look for a zero with $\sum x\_i = aq$. Then $f(x\_1,\dots,x\_m)=0$ will follow from the two equations:
$$\begin{cases}
\sum\_{i=1}^m x\_i = aq, \\
\sum\_{i=1}^m x\_i^2 = (k-1)aq + a.
\end{cases}
$$
We will show that there is a solution containing only $0$'s, $1$'s, $2$'s, $(k-1)$'s and $k$'s, i.e.
$$\begin{cases}
u + 2v + (k-1)w + kt = aq,\qquad(\star) \\
u + 4v + (k-1)^2w + k^2t = (k-1)aq + a,
\end{cases}
$$
where $u,v,w,t$ are the multiplicities of $1$'s, $2$'s, $(k-1)$'s, $k$'s, respectively.


This system has an integer solution whenever
\begin{split}
(k-1) &\mid k^2(aq-u-2v) - k((k-1)aq + a - u - 4v),\\
k&\mid (k-1)^2(aq-u-2v) - (k-1)((k-1)aq + a - u - 4v),
\end{split}
that is
$$\begin{cases}
2v \equiv - a(q-1) \pmod{k-1},\\
2u + 6v \equiv a\pmod{k}.
\end{cases}$$


We fix integers: 
\begin{split}
\text{if $k$ is even:} & \qquad\begin{cases}
v := \frac{-a(q-1)}2\bmod (k-1), \\
u := \frac{a}{2} - 3v\bmod{\frac{k}2},
\end{cases}
\\
\\
\text{if $k$ is odd:} & \qquad \begin{cases}
v := \frac{-a(q-1)}2\bmod \frac{k-1}2, \\
u := \frac{a}{2} - 3v\bmod{k},
\end{cases}
\end{split}
to further obtain integers:
\begin{split}
w &:= \frac{a(q-1)-(k-1)u-2(k-2)v}{k-1},\\
t &:= \frac{a+(k-2)u + 2(k-3)v}k.
\end{split}


From definition of $u,v$, we have that they are smaller than $k$. It further follows that for a fixed $k$ and large enough $m$ (and thus large enough $aq$), values $w$ and $t$ are positive. From equation $(\star)$ it also follows that $u+v+w+t<m$. So, we constructed a zero of $f$ different from the trivial ones.




---


For $k=3$, the above construction works but $2$'s and $(k-1)$'s collapse and have total multiplicity $v+w$. Similarly, for $k=2$, we get a solution with $1$'s and $2$'s having multiplicities $u+w$ and $v+t$, respectively.


