Is this correct? Is there a faster way to demonstrate it?

25 Views Asked by At

here are the instructions:
1) Prove that if $n$ is an even natural integer, then $n^2\equiv 0\pmod4$
2) Prove that if $n$ is an odd natural integer, then $n^2\equiv 1\pmod4$

1) If $n$ is even then it equals to $2k$ where $k \in \mathbb{N}$
$$4\equiv0\pmod4\Leftrightarrow4k^2\equiv0\pmod4 \Leftrightarrow(2k)^2\equiv 0\pmod4\Leftrightarrow n^2\equiv 0\pmod4$$
2) If $n$ is odd then it equals to $2k+1$ where $k \in \mathbb{N}$

According to 1), $2k\equiv 0\pmod4$. We also know that $1\equiv 1\pmod4$. Hence we have:
$$2k+1\equiv 1\pmod4 \Leftrightarrow (2k+1)^2\equiv 1\pmod4 \Leftrightarrow n^2\equiv 1\pmod4$$
Thanks in advance for taking your time reviewing my work.

2

There are 2 best solutions below

2
On BEST ANSWER

The proof can be written with less clutter.

When $n=2k$, then $n^2=4k^2$, a multiple of $4$. So $n^2\equiv 0\ \pmod 4$.

For the second one, you have to expand the square.

If $n=2k+1$, then $n^2=(2k+1)^2=4k^2+4k+1=4(k^2+k)+1$. So $n^2$ is a multiple of $4$ plus $1$, i.e. $n^2\equiv 1\ \pmod 4$.

1
On

First part is correct.
However for second part, this is wrong.

$$2k \equiv 0 \pmod 4 \,\ \forall \,\ k \in \mathbb{N}$$

You should proceed like this:
Say $n=2k+1$
So $n^2=4k^2+4k+1=4k(k+1)+1=4m+1$
Hence $n^2 \equiv 1 \pmod 4$