Finding generating function and closed formula

94 Views Asked by At

Find generating function and closed formula $1,0,1,0,1,0,1,0,1,...$

Solution Attempt)

$$\begin{align}G(x) &= 1 + 0x + 1x^2 + 0x^3 + 1x^4 + 0x^5 + 1 x^6 + 0 x^7 + 1 x^8 + \dots\\ &= 1 + x^2 + x^4 + x^6 + x^8 + \dots\end{align}$$

$$G(x) = \sum_{k = 0}^{∞} x^{2k} = \sum_{k = 0}^{∞} (x^{2})^k = \frac{1}{1-x^2}$$

2

There are 2 best solutions below

0
On

Following Ethan remark, we have

$$u_{2n}=1=|\sin((2n+1)\frac{\pi}{2})|$$ and

$$u_{2n+1}=0=|\sin((2n+2)\frac{\pi}{2})|$$

So, we can take $$f(x)=|\sin((x+1)\frac{\pi}{2})|$$

0
On

I think you've already made this simple observation:

$$a_n=n~\text{mod}~2=n - 2 \left\lfloor \frac n2 \right\rfloor$$

But, this is the formula that sounds more lovable to me: (just a little observation is enough to construct this formula)

$$a_n = \frac 12 \left((-1)^{n+1} + 1\right).$$