Problem
For every positive integer $n$, a unique positive integer $f(n)$ is assigned in the following manner: $f(1)=1$ and for every positive integer $n$, $f(f(n))=n$ and $f(2n)=2f(n)+1$. Find the value of $f(2020)$ with a proof.
My Approach
Given : $f(1)=1$ and $f(2)=2[f(1)]+1=3$.
Claim $1$: if $f(a)=b$, then $f(b)=a$ for all positive integers $a$ and $b$.
Proof: $f(a)=b$, given $f(f(n))=n$, then $f[f(a)]=a$, therefore $f(b)=a$.
We know that $f(2)=3$, therefore $f(4)=7, f(8)=15, f(16)=31, f(32)=63$.
From Claim $1$
- $f(63)=32$. Then, $f(126)=65, f(252)=131$.
- $f(131)=252$, therefore $f(262)=505$.
- $f(505)=262$, therefore $f(1010)=525$, thus $f(2020)=1051$.
I want to know whether my proof given below is correct and whether there's a better proof than mine.