<s>[INST] Find the generating function of the sequence I need to find generating function of sequence : $$\left\{0, 1, \frac12, \frac23, \frac24, \frac45, \frac46, \frac87, 1, \frac{16}9, \frac{16}{10}, \ldots\right\}$$
I saw that odd positions are $\frac{2^n}{2n+1}$ where $n$ goes from $0$ to $\infty$, but nothing else.
Any help would be appreciated.
 [/INST] Let $a_0=0$, $a_1=1$, $a_2=\frac{1}{2}$, $a_3=\frac{2}{3}$, $a_4=\frac{2}{4},\dots$ and notice that the denominator of $a_n$ is $n$. For the numerator, notice that these are powers of $2$ and come in pairs. The coming in pairs part is ensured by $\lfloor\frac{n-1}{2}\rfloor=\max\{k\in\mathbb Z:k\le\frac{n-1}{2}\}$, i.e. the function rounding down. Combining this gives $a_n=\frac{2^{\lfloor\frac{n-1}{2}\rfloor}}{n}$ and hence the generating function $\sum_{n=1}^\infty\frac{2^{\lfloor\frac{n-1}{2}\rfloor}}{n}x^n$.
The sum for even $n$ is $\sum_{k=1}^{\infty}\frac{2^{k-1}}{2k}x^{2k}=\frac{1}{4}\sum_{k=1}^{\infty}\frac{1}{k}(2x^2)^{k}=-\frac{1}{4}\ln|1-2x^2|$, using the anti-derivative of the geometric series $\sum_k b^k=\frac{1}{1-b}$ to obtain $\sum_k\frac{1}{k+1}b^{k+1}=-\ln|1-x|$. The sum for odd $n$ is $\sum_{k=0}^{\infty}\frac{2^{k}}{2k+1}x^{2k+1}=\frac{1}{\sqrt{2}}\sum_{k=0}^{\infty}\frac{1}{2k+1}(\sqrt{2}x)^{2k+1}=\frac{1}{2\sqrt{2}}\ln\frac{1+\sqrt{2}x}{1-\sqrt{2}x}$, the series expansion of the inverse hyperbolic tangent, which I found using WolframAlpha. So, in total we get
$$\sum_{n=1}^\infty\frac{2^{\lfloor\frac{n-1}{2}\rfloor}}{n}x^n
=-\frac{1}{4}\ln|1-2x^2|+\frac{1}{2\sqrt{2}}\ln\frac{1+\sqrt{2}x}{1-\sqrt{2}x}.$$
</s>