What's the generating formula for this sequence

122 Views Asked by At

Can someone help me finding the generating formula for this sequence?

$$[1,1,3,5,5,7,9,9,11,13,13...]$$

Thanks!

3

There are 3 best solutions below

2
On BEST ANSWER

Assuming that $\{a_n\}_{n\geq 0}$ is the weakly increasing sequence $1,1,3,5,5,7,9,9,13,\ldots$ given by repeating twice every number of the form $4n+1$, just once every number of the form $4k+3$, and: $$ f(x) = \sum_{n\geq 0} a_n x^n,\tag{1}$$ we have: $$\begin{eqnarray*} f(x) &=& \sum_{k\geq 0}\left[(4k+1) x^{3k}+(4k+1)x^{3k+1}+(4k+3)x^{3k+2}\right]\\&=&(1+x+x^2)\sum_{k\geq 0}(4k+1)x^{3k}+2\sum_{k\geq 0}x^{3k+2}\\&=&(1+x+x^2)\cdot\frac{1+3x^3}{(1-x^3)^2}+2\cdot\frac{x^2}{1-x^3}\\&=&\color{red}{\frac{1+2x^2+x^3}{(1-x)^2(1+x+x^2)}}.\tag{2}\end{eqnarray*} $$ By partial fraction decomposition we may check that:

$$ a_n = \frac{4n+1+\frac{4}{\sqrt{3}}\sin\left(\frac{2\pi}{3}(n+1)\right)}{3}.\tag{3} $$

1
On
1
On

If you want an explicit form for the sequence, then it is of course correct to state that $$a_n=\frac{4n+1+\frac{4}{\sqrt{3}} \sin \left( \frac{2\pi}{3}(n+1)\right)}{3}$$ as done above. But there is also another (much simpler) term for $a_n$ which pays tribute to the simplicity of the underlying pattern: $$a_n=1+2 \cdot \lfloor \frac{2n-2}{3} \rfloor$$ where $\lfloor x \rfloor$ is the floor function (i.e. the largest integer smaller than $x$).