[Math] Is the proof correct: if $n$ is odd then $n^2$ is odd

elementary-number-theory

Prove that for every integer $n,$ if $n$ is odd then $n^2$ is odd.

I wonder whether my answer to the question above is correct. Hope that someone can help me with this.

Using contrapositive, suppose $n^2$ is not odd, hence even. Then $n^2 = 2a$ for some integer $a$, and
$$n = 2(\frac{a}{n})$$ where $\frac{a}{n}$ is an integer. Hence $n$ is even.

Best Answer

You will want to use contrapositive for proving the converse of this statement, and in most introductory proof classes the professor should make a point of this. That is to say, for the question you posed the cleanest proof is given as follows,

Claim: If $n$ is odd, then $n^2$ is odd, for all $n \in \mathbb{Z}$.

Proof: Assume that $n$ is odd, then $n=2k+1$, for some $k \in \mathbb{Z}$. Hence, $$n^2 = (2k+1)^2= 4k^2 + 4k + 1 = 2(2k^2 + 2k) +1 $$ where $(2k^2 + 2k) \in \mathbb{Z}$. Therefore, $n^2$ is odd as desired.

Whereas, for the converse you will quickly run into trouble if you do not try a proof by contrapositive (Exercise: Try it with a direct proof and see where you get stuck!)

Claim: If $n^2$ is odd, then $n$ is odd, for all $n \in \mathbb{Z}$.

Proof: By contrapositive, the claim is logically equivalent to, "If $n$ is even then $n^2$ is even, for all $n \in \mathbb{Z}$". Assume that $n$ is even, then $n=2k$, for some $k \in \mathbb{Z}$. Hence, $$n^2 = (2k)^2 = 4k^2 = 2(2k^2)$$ where $2k^2 \in \mathbb{Z}$. Therefore, $n^2$ is even as desired.

Related Question