# If $xy$ and $x+y$ are both even integers (with $x,y$ integers), then $x$ and $y$ are both even integers

The title statement can be proven using the contrapositive, note that $x$ odd or $y$ odd means that at least one of $x\cdot y,x+y$ is odd. Is there a way to prove the statement directly?

To generalize on this statement (in two integer variables), show that for every square free integer $n$, there exists a function $f:\mathbb Z^2\to\mathbb Z$ where

$$f(x,y)\equiv 0\pmod n\iff x\equiv y\equiv 0\pmod n$$

This generalization is formalized in this question: If $n$ is squarefree, $k\ge 2$, then $\exists f\in\Bbb Z[x_1,\dots,x_k] : f(\overline x)\equiv 0\pmod n\iff \overline x\equiv \overline 0\pmod n$

Observe that $\displaystyle (x+1)(y+1)=xy+x+y+1$ is odd as $xy,x+y$ are even

If $x$ is odd $\iff x+1$ is even

• This one is my favorite, since limiting $x,y\in\mathbb Z^+$ makes $xy+x+y$ produce the set of non-prime numbers (with each having value $k-1$, $k$ is not prime). – abiessu Oct 25 '13 at 11:46
• I also definitely appreciate the irony that you have used an arithmetic contrapositive with direct logic in place of contrapositive logic with direct arithmetic. Does this proof mechanism help in solving the generalization added to the question? – abiessu Oct 25 '13 at 18:49
• @abiessu, Could you please create a fresh Question with the added part (may be linking with this Question) to draw the attention of a larger audience. In general, it should be discouraged to have multiple problems in one Question, specially after accepting the answer. – lab bhattacharjee Oct 26 '13 at 4:56
• Yes, that makes sense, I'll put that together later today... – abiessu Oct 26 '13 at 14:33
• Done, question is here. – abiessu Oct 27 '13 at 16:08

If $x+y$ is even, then either both $x$ and $y$ are odd, or they are both even. Therefore $x$ and $y$ are both even because otherwise $xy$ would be odd.

Note that $$x^2=(x+y)x-xy$$ and $$y^2=(x+y)y-xy$$ being the differences of two even numbers, are both even.

Thus, both $x$ and $y$ are even.

• This is an excellent non-obvious way to prove it. Can you extend your method to demonstrate the generalization I mention in the updated question? – abiessu Oct 25 '13 at 15:54

If $xy$ is even, then $x$ or $y$ is even. If $x+y$ is even and $x$ is even, then so is $y$. If $x+y$ and $y$ are even, then so is $x$.

Begin with the quantities $x\cdot y$ and $x+y$ given as even integers where $x,y$ are integers. Then we have that $2|x\cdot y\implies 2|x\text{ or }2|y$. Without loss of generality, assume that $2|x\implies \exists m\in\mathbb Z\text{ such that }x=2m.$ Next, we have $2m+y$ is even, which means that $\exists n\in\mathbb Z$ such that $2m+y=2n$ which means that $y=2n-2m$. $m,n$ are integers, so $2n-2m$ is even and therefore $y$ is even.

Thus we have shown directly that $x\cdot y$ and $x+y$ both even for $x,y$ integers implies that $x$ and $y$ are both even integers.

• $2m+y=2n$ then $y=2n-2m$ – Wmmoreno Oct 25 '13 at 5:40
• @Wmmoreno: corrected, thank you – abiessu Oct 25 '13 at 11:41

Here if x+y is even then x and y both are even or both are odd. If one is even and other is odd, x+y will be odd. But to make xy even both x and y should be even or either x or y should be even. If both are odd then xy will be odd. Hence it can be proven then to make xy and x+y even, x & y should be even. Take any value of x and y and check the answer.