# Prove that if n is even then $n^2$ is even and if n is odd then $n^2$ is odd?

How can I prove that if $n$ is even then $n^2$ is even and if $n$ is odd then $n^2$ is odd?

• even numbers are of the form $2n$ and odd numbers $2n+1$. – imranfat Jan 20 '17 at 16:54
• Hint: all even integers can be written as $2k$ $\forall k\in\mathbb{Z}$ and all odd integers can be written as $2k+1$ $\forall k\in\mathbb{Z}$. What do you get when you square each? – Michael McGovern Jan 20 '17 at 16:58

Let $n=2k$ when $n$ is even and $n=2k+1$ when $n$ is odd $\forall k\in\mathbb{Z}$.

When $n = 2k$ $\implies$ $n^2 = 4k^2$, which is even.

And when $n = 2k + 1$ $\implies$ $n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1$ , which is odd.

Hint:

$$n^2-n=n(n-1)$$ which is even being product of two consecutive integers

So, $n^2,n$ have the same parity.

More generally, we can prove $n, n^m( m\ge1)$ have the same parity.

• I think it's misleading to call it just a hint :) Then again, this is a remarkably elegant proof. – Anonymous Jan 20 '17 at 17:24

An integer is even iff it is of the form $2n$ and an integer is odd iff it is of the form $2n+1$. In both cases $n$ is an integer. Hence $$(2n)^2=4n^2=2(2n^2)$$ $$(2n+1)^2=4n^2+4n+1=2(2n^2+2n)+1$$ Since $n$ is an integer, both $2n^2$ and $2n^2+2n$ are integers.

1. When n is even. Then n = 2k.

$n^2 = (2k)^2$

= $2(2k^2)$

= $2t$ where $t = 2k^2$

Which is same form as even numbers as you can see.

1. When n is odd. Then n = 2k + 1

$n^2 = (2k + 1)^2$

= $4k^2 + 4k + 1$

= $2(2k^2 + 2k) + 1$

= $2t + 1$ where $t = 2k^2 + 2k$

Which is odd as you can see.

Suppose $n$ is even. Let $p=n/2$.

$n^2=4p^2$ which must be even since $p$ is a whole number.

Suppose $n$ is odd and let p=$n+1$.

$p^2$ is therefore even by the above rule.

$n=(p-1)^2=p^2-2p+1$.

$p^2-2p$ must be even so $n$ is therefore odd.

assuming $n$ is even, then we have $$n=2m$$ for some integer $m$, thus by squaring we have $$n^2=4m^2=2(2m^2)=2m'$$ form some integers $m'$ and $$n^2$$ is even analogously we get if $n$ is odd we have $$n=2k+1$$ for some integer $k$ then we get by squaring $$n^2=4k^2+4k+1=4k(k+1)+1$$ and this is odd

• Seems unnecessarily confusing. – Joffan Jan 20 '17 at 17:02