Let $f: \mathbb N \rightarrow \mathbb N$ are increasing function such that $f\left(f(n)\right)=3n$. Find $f(2017)$ [duplicate]

Let $f: \mathbb N \rightarrow \mathbb N$ are increasing function such that $$f\left(f(n)\right)=3n$$ for any positive integer $n$.

Find $f(2017)$

My work so far:

1) If $m\not=n$ then $f(m)\not= f(n)$

2) $f(3n)=3f(n)$


Step I: if $n=3^a+b$ with $0≤b<3^a$ then $f(n)=2\times 3^a+b$.

Proof: by induction. Easy to prove that $f(3^a)=2\times 3^a$ and $f(2\times 3^a)=3^{a+1}$. As there are exactly $3^a+1$ integers in the interval $\left[2\times 3^a,3^{a+1}\right]$ the claim follows.

Step II. Remark that $2017=2\times 3^6+559$

To conclude, we have $f(3^6+559)=2\times 3^6+559=2017$. thus $$f(2017)=f(f(3^6+559))=3^7+3\times 559= \fbox {3864}$$

Note: I would check the arithmetic on this, but the method should be sound.