How to prove statements $m^2+mn+n^2$ is even $\iff$ $m$ and $n$ are both even
I have tried m and n both even $\Rightarrow$ $m^2+mn+n^2$ is even by:
$m=2p$
$n=2q$
$(2p)^2+2p*2q+(2q)^2$
$4p^2+4pq+4q^2$
$2(2p^2+2pq+2q^2)$
$2$ times an integer makes it even. I am unsure how to prove it the other way and whether my proof is even correct.
Thank you
 A: There are three cases:none are even, one is even, or both are even:
If none is even then $m^2, mn$ and $n^2$ are all odd and the sum of three odds is odd.
if one is even then $mn$ is even an exactly one of $m^2$ and $n^2$ is even. therefore it is the sum of one odd and two evens which is odd.
if all are even then $m^2, mn$ and $n^2$ are even which makes the sum even.
A: To prove $$m^2 + mn + n^2 \implies m, n \text{ are both even},$$ 
Prove: $$\lnot (m, n \text{ are both even}) \implies m^2 + mn + n^2 \;\text{is not even.}$$Assume that "It is not the case that $m, n$ are both even."
So there are three cases to consider.


*

*$m$ odd, $n$ odd.

*$m$ odd, $n$ even.

*$m$ even, $n$ odd.


Considering the first case and either of the second two cases suffices.
A: Noting: $$m^2+mn+n^2=(m+n)^2-mn$$
If it is even then both $mn$ and $(m+n)^2$ are even.
It means (m+n) is even so both m and n are even.
A: I think the most obvious ways to do this is to observe that for expressions involving only addition, subtraction, and multiplication (like $m^2+mn+n^2$; subtraction is not even used here) one can always deduce its parity from the parities of all ingredients (here $m$ and $n$). The reason is you can do this for every basic addition, subtraction and multiplication used, working from smaller to larger subexpressions. Since that makes only $2\times2=4$ possibilities in all, it becomes a no-brainer: for all combinations of the parities of $m$ and $n$, compute the parity of $m^2+mn+n^2$. Only in case both $m$ and $n$ are even does the result become even, in the three other cases it becomes odd. This check is perfectly fine as a proof.
Of course one would prefer another method if there were a dozen or so different variables in the problem.
A: Modulo $2$ we have
$$m^2+mn+n^2\equiv m+ mn+n\equiv(m+1)(n+1)-1\ .$$
It follows that the left side is $\equiv0$ iff $(m+1)(n+1)\equiv1$, i.e., iff $m\equiv n\equiv0$.
