Prove for some finite $k$, $f^k(n)=1 \forall n \in \mathbb{N} $

41 Views Asked by At

Consider a function $f:\mathbb{N} \rightarrow \mathbb{N}$ defined as $$f(n)=n+1$$ if $n$ is composite or 2. $$f(n)=\frac{n-1}{2}$$ if $n$ is prime. Prove that for some finite $k$ $f^k(n)=1$, $\forall n\in \mathbb{N}$.

Can anyone help?

1

There are 1 best solutions below

0
On

I suspect that the question you are trying to ask is this:

Consider a function $f:\mathbb{N} \rightarrow \mathbb{N}$ defined as $$ \begin{cases}f(n)=n+1 & n\text{ is composite or } n=2\\ f(n) = \frac{n-1}{2} & n \text{ is prime.} \end{cases} $$ Prove that for every $n$, there exists an integer $k$ such that $f^k(n)=1$, $\forall n\in \mathbb{N}$.

If this is the question, then here is a hint: use the Bertrand-Chebyshev theorem.