Problem

Source: Thirty Third Irish Mathematical Olympiad 2020 P7/10

Tags: algebra, functional equation



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)$.