3

This is my first time posting. I'm sorry if I'm neglecting some good etiquette practices; I tried to read everything that's been sent my way, but I probably missed something anyway. Also, English is not my first language, so I'm relying on Google to translate math-specific terminology. If something isn't clear, please let me know!

I'm a Computer Science student at University, and I've been requested to find a function $f: \Bbb{N}\to\Bbb{N}$ such that $\forall n \in \Bbb{N}$, $f(3n) = 3n \land f\neq \mathrm{id}_\Bbb {N}$. I absolutely cannot find a solution, as $f(x) = x$ (and, as such, $f(3n) = 3n$ too) literally is the definition of identity function as far as I know... Am I missing something? Thanks in advance.

EDIT: Thanks a lot everyone!

J. W. Tanner
  • 60,406
GLB
  • 33

3 Answers3

1

What about$$f(n)=\begin{cases}n&\text{ if }3\mid n\\1&\text{ otherwise?}\end{cases}$$Then you have $(\forall n\in\Bbb N):f(3n)=3n$, right?!

1

Your function is from $\Bbb{N}$ to $\Bbb{N}$, so the equation

$$f(3n) =3n\tag1$$

means

\begin{align} &f(3) = 3\\ &f(6) = 6\\ &f(9) = 9\\ &\cdots \cdots \cdots \end{align}

so for natural numbers other than multiple of $3$, the function $f$ may have $any$ natural value and still satisfy the equation $(1)$.

So it is sufficient to assign e.g. $f(2) = 100$, and for all other natural numbers $f(n) = n$.

MarianD
  • 2,953
1

You want $f|_{3\mathbb N}$ ($f$ restricted to multiples of $3$) to be the identity function

but $f$ not to be the identity function.

There are many ways to accomplish this; others have given some. Here are two alternatives:

(a) $f(n)=n$ for $n\ne1$ and $f(1)=2$

(b) $f(3n)=3n$, $f(3n+1)=3n+2$, and $f(3n+2)=3n+1$.

J. W. Tanner
  • 60,406