<s>[INST] 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?
 [/INST] 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$.
</s>