Prove that the function $f:\Bbb N \rightarrow \Bbb N,$ defined by $f(n)=6\lceil \frac{n}{3} \rceil -n-2$ is surjective.
I don't know given $n \in \Bbb N$,what element in the domain should I take to give $n$. Can someone help me, please?
Prove that the function $f:\Bbb N \rightarrow \Bbb N,$ defined by $f(n)=6\lceil \frac{n}{3} \rceil -n-2$ is surjective.
I don't know given $n \in \Bbb N$,what element in the domain should I take to give $n$. Can someone help me, please?
On
Because $\lceil \frac{n}{3} \rceil \geq \frac{n}{3}$, $6 \lceil \frac{n}{3} \rceil \geq 2n$. $-n-2$ is obviously always less than $2n$ when $n > 2$, and it is also less when $n = 1$ and $n = 2$ (I plugged in and checked).
Because of this, you know that the subtraction $2n - (n + 2)$ always has a natural number result when $n$ is a natural number.
Hint: Since we're taking the ceiling of $\frac{n}{3}$, it makes sense to consider the three cases $n=3k+1$, $n=3k+2$, and $n=3k+3$.
Suppose that $n=3k+1$. Then $$f(n)=6\left\lceil\frac{3k+1}{3}\right\rceil-(3k+1)-2=6\left\lceil k+\frac{1}{3}\right\rceil-3k-3=6(k+1)-3k-3=3k+3.$$
Suppose that $n=3k+2$. Then $$f(n)=6\left\lceil\frac{3k+2}{3}\right\rceil-(3k+2)-2=6\left\lceil k+\frac{2}{3}\right\rceil-3k-4=6(k+1)-3k-4=3k+2.$$
Suppose that $n=3k+3$. Then $$f(n)=6\left\lceil\frac{3k+3}{3}\right\rceil-(3k+3)-2=6\left\lceil k+1\right\rceil-3k-5=6(k+1)-3k-5=3k+1.$$
Therefore, $f$ takes $\{3k+1,3k+2,3k+3\}$ to itself (although not in the same order). Can you use this to prove surjectivity?