A function $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfies the following for all $n \in \mathbb{N}$ : \begin{align*} f(1) &=1 \\ f(f(n)) &=n \\ f(2 n) &=2 f(n)+1 \end{align*}Find the value of $f(2020)$.
Problem
Source: Thirty Third Irish Mathematical Olympiad 2020 P7/10
Tags: algebra, functional equation
20.07.2020 20:40
Solution Note: We assume from the question that such a function exists. If $f(a) = b$, then $f(f(a)) = f(b) = a$. We use this rule along with the given conditions to calculate values of $f(n)$ that lead to $f(2020)$. \begin{align*} f(1) = 1 \implies f(2) = 2f(1) + 1 = 3, \\ f(4) = 2f(2) + 1 = 7, \\ f(8) = 2f(4) + 1 = 15 \implies f(15) = 8,\\ f(30) = 2f(15) + 1 = 17 \implies f(17) = 30,\\ f(16) = 2f(8) + 1 = 31 \implies f(31) = 16,\\ f(32) = 2f(16) + 1 = 63 \implies f(63) = 32, \\ f(126) = 2f(63) + 1 = 65, \\ f(252) = 2f(126) + 1 = 131. \end{align*}Now we have $$ f(2020) = 2f(1010) + 1 = 2(2f(505) + 1) + 1 = 4f(505) + 3. $$Then calculating, \begin{align*} f(252) = 131 \implies f(131) = 252 \\ f(262) = 2f(131) + 1 = 2(252) + 1 = 505, \end{align*}so $f(505) = 262$, and $$ f(2020) = 4f(505) + 3 = f(262) + 3 = 1051. $$
21.07.2020 09:10
circlethm wrote: A function $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfies the following for all $n \in \mathbb{N}$ : \begin{align*} f(1) &=1 \\ f(f(n)) &=n \\ f(2 n) &=2 f(n)+1 \end{align*}Find the value of $f(2020)$. We immediately get $f(2n)=2f(n)+1$ and $f(2n+1)=2f(n)$ So $f(n)$ is the positive integer obtained by replacing each digit (except the leading $1$) in binary representation of $n$ by its opposite. So $f(2020)=f(\overline{11111100100})=\overline{10000011011}=1051$ Note that we easily get the closed form $\boxed{f(n)=3\times2^{\left\lfloor\log_2 n\right\rfloor}-n-1}$
05.10.2023 13:58
How do you prove $f(2n+1)=2f(n)$?
05.10.2023 14:06
kgukv wrote: How do you prove $f(2n+1)=2f(n)$? $f(2n)=2f(n)+1\Rightarrow f(2f(n)+1)=2n\Rightarrow f(2n+1)=2f(n)$