If $a+b+c+d = 4m+1$ where $m$ is a positive number and $a , b,c,d \in \mathbb Z$ , then the minimum value of $a^2+b^2+c^2+d ^2$ is $4m^2 +2m +1$. If $a+b+c+d = 4m+1$ where $m$ is a positive number and $a , b,c,d \in \mathbb Z$ , then the minimum value of $a^2+b^2+c^2+d ^2$ is $4m^2 +2m +1$.
How to prove it without using calculus?
I know if $a , b,c,d \in \mathbb R$ then $a^2+b^2+c^2+d ^2$ will be minimum when $a =b= c =d = \frac{4m+1}{4}$..So the minimum value would have been $4m^2 +2m +1/4$..But what to do in that case?
 A: The nearest integer greater than $4m^2 +2m +1/4$ is $4m^2 +2m +1$..And if we consider $a=b=c =m $ and $d=m+1$.We can get this minimum value.
A: Taking $a = b = c = m$ and $d = m + 1$ gives that $a^2 + b^2 + c^2 + d^2 = 4m^2 + 2m + 1$, implying that the minimum value of the expression is at most $4m^2 + 2m + 1$. The calculus approach you mentioned, or maybe an application of the Cauchy-Schwarz inequality would lead to the fact that taking all the terms equal gives the minimum value of the expression, and the choice above is simply to ensure that all terms are integers in a way that is closest to all of them being equal.
Finally, to check that this works for any $a, b, c, d$ we assume first that $a \le b \le c \le d$. Then, $4d \geq 4m + 1$ which implies $d \geq m+1$ since $d$ is an integer. Thus, we can write
\begin{align*}
a^2 &+ b^2 + c^2 + d^2 \\
&= (a-m+m)^2 + (b-m+m)^2 + (c-m+m)^2 + (d-m-1+m+1)^2 \\
&= (a-m)^2 + (b-m)^2 + (c-m)^2 + (d - m-1)^2 + \\
& \qquad + 2m(a-m + b-m + c-m + d-m) -2m + 2(d - m - 1) \\
& \qquad + m^2 + m^2 + m^2 + (m+1)^2 \\
&= (a-m)^2 + (b-m)^2 + (c-m)^2 + (d - m-1)^2 + \\
& \qquad + 2m - 2m + 2(d - m - 1) \\
& \qquad + 4m^2 + 2m + 1 \\
&\geq 4m^2 + 2m + 1.
\end{align*}
A: Wlog. $a\le b\le c\le d$. If $d\ge a+2$, then 
$$ (a+1)^2+b^2+c^2+(d-1)^2=a^2+b^2+c^2+d^2+2(1+d-a)<a^2+b^2+c^2+d^2,$$
hence for a minimizer $d\le a+1$. If $k$ of the numbers $a,b,c,d$ are $=a+1$, then $4m+1=a+b+c+d=4a+k$. We conclude $k=1$, and then $a=b=c=m$ and $d=m+1$.
