# Prove that the function: f: $\mathbb{N} \mapsto \mathbb{Z}$ defined as f(n)= $\frac{(-1)^n(2n-1)+1}{4}$ is bijective.

Prove that the function: f: $\mathbb{N} \mapsto \mathbb{Z}$ defined as f(n)= $\frac{(-1)^n(2n-1)+1}{4}$ is bijective.

This is rough. I've been staring at this one for a while now. I get stuck on the injective part. I set f(a)=f(b), and I'm trying to show a=b. It's straightforward up to $(-1)^a(2a-1)=(-1)^b(2b-1)$. From there I'm at a loss of how to proceed.

I'd also appreciate a hand on the surjective part.

• Assume for contradiction that $(-1)^a\ne (-1)^b$, then show that then $a+b=1$, it this possible? If it is not possible then you get that $2a-1=2b-1$. – user119615 Dec 16 '14 at 0:45

So let $f(a)=f(b)$. Since $f(n_{odd})\le0$ if $n_{odd}$ is an odd natural number and $f(n_{even})>0$ if $n_{even}$ is an even natural number, we must have that if:

$f(a)=f(b)$

Then either a and b are both even or both odd. With that in mind, we first consider a and b both even:

$(-1)^a(2a-1)=(-1)^b(2b-1)$

$(2a-1)=(2b-1)$

$a=b$

And then a and b odd:

$(-1)^a(2a-1)=(-1)^b(2b-1)$

$-(2a-1)=-(2b-1)$

$a=b$

For the surjective part: let $b\in\mathbb{Z}$ and let $b>0$. Then choose 2b:

$f(2b)=\frac{(-1)^{2b}(4b-1)+1}{4}=b$

Now let $b<0$

$f(-2b+1)=\frac{(-1)^{-2b+1}(2(-2b+1)-1)+1}{4}=\frac{(-1)(-4b+2-1)+1}{4}=\frac{4b}{4}=b$

Hint for the first part (injectivity): Both $2a - 1$ and $2b - 1$ are positive.