I can't find out a function f(x)=y that would map my x's to required y's. It is OK to write it in a programming language. Notation in mathematics is also OK.
It must be something simple enough but I can't find a solution.
X: >> Y:
1 1
2 1
3 2
4 2
5 4
6 4
7 8
8 8
9 16
10 16
...
So note that the $y$s are powers of 2 and that for $k \in \mathbb N$ the numbers $2k$ and $2k - 1$ are mapped to $2^k$. that is if we divide $x$ by $2$ and round towards the next bigger integer, that is consider $\lceil \frac x2\rceil$, this gives $k$ for both cases. So $f \colon \mathbb N \to \mathbb N$ is given by $$ f(x) = 2^{\lceil \frac x2\rceil - 1} $$