Problem

Source: Ukraine 1997 grade 10

Tags: function, algebra unsolved, algebra



Let $ d(n)$ denote the largest odd divisor of a positive integer $ n$. The function $ f: \mathbb{N} \rightarrow \mathbb{N}$ is defined by $ f(2n-1)=2^n$ and $ f(2n)=n+\frac{2n}{d(n)}$ for all $ n \in \mathbb{N}$. Find all natural numbers $ k$ such that: $ f(f(...f(1)...))=1997.$ (where the paranthesis appear $ k$ times)