## CURIOUS SERIES-001

16 08 2009

There´s a very common finite series, that use to be, at the begining on every book:

$\displaystyle S_{n}(z)=\sum _{k=0}^n z^k =\frac{z^{n+1}-1}{z-1}$

Where $z$ can be real or complex.

There is a, very well known, particular case of this series where $z=2$:

$\displaystyle S_{n-1}(2)=\sum _{k=0}^{n-1} 2^{k} =2^{n}-1=M_n$

$\displaystyle M_n$ are the Mersenne Numbers, and due to this sum, is easy to see that the Mersenne numbers consist of all 1s in base-2 (they are base 2 repunits)

But this entry is about another particular case of this finite sum:

$\displaystyle S_{n}(\textbf{i})=\sum _{k=0}^{n} \textbf{i}^k$

Where: $\textbf{i}=\sqrt{-1}$, is the complex unit.

$\displaystyle S_{n}( \textbf{i} ) =\frac{1}{2}(1+\textbf{i}) \left(1-\textbf{i}^{n+1}\right)$

This sum shows periodical behaviour with a period of $4$, and its values changes from one vertex to another in a square of side equal to $1$, if we plot them in the complex plane:

$\displaystyle S_{n}( \textbf{i} )=\{1,1+\textbf{i},\textbf{i},0,1,1+\textbf{i},\textbf{i},...\}$

$\displaystyle S_{n}(\textbf{i})=1\;$ if $\;n\equiv 0\;mod\;4$

$\displaystyle S_{n}(\textbf{i})=1+\textbf{i}\;$ if $\;n\equiv 1\;mod\;4$

$\displaystyle S_{n}(\textbf{i})=\textbf{i}\;$ if $\;n\equiv 2\;mod\;4$

$\displaystyle S_{n}(\textbf{i})=0\;$ if $\;n\equiv 3\;mod\;4$

If we take a look at the real part of the complex number $S_{n}(\textbf{i})$:

$\displaystyle Re\bigg(\sum _{k=0}^{n} \textbf{i}^k\bigg)=\{1,1,0,0,1,1,0,0,...\}$

Then we had just found the sequence A133872 from OEIS, and then we can construct another expressions for this sequence, and also for the problem series:

$\displaystyle A133872(n)=Re\bigg(\sum _{k=0}^{n} \textbf{i}^k\bigg)$

$\displaystyle A133872(n)=\frac{1}{2}\bigg(\sum _{k=0}^{n} \textbf{i}^k + \sum _{k=0}^{n} \textbf{i}^{-k}\bigg)$

$\displaystyle A133872(n)=\frac{1}{2}+\frac{1}{2} \text{cos}\left(\frac{n \pi }{2}\right)+\frac{1}{2} \text{sin}\left(\frac{n \pi }{2}\right)$

Then, if we expand to trigonometrical functions $S_{n}( \textbf{i} )$:

$\displaystyle S_{n}( \textbf{i} ) =\left(\frac{1}{2}+\frac{1}{2} \text{cos}\left(\frac{n \pi }{2}\right)+\frac{1}{2} \text{sin}\left(\frac{n \pi }{2}\right)\right) + \textbf{i} \left( \frac{1}{2}-\frac{1}{2} \text{cos}\left(\frac{n \pi }{2}\right)+\frac{1}{2} \text{sin}\left(\frac{n \pi }{2}\right)\right)$

And finally using the information inside OEIS:

$\displaystyle S_{n}( \textbf{i} )= \text{mod}\left(\bigg\lfloor\frac{n+2}{2}\bigg\rfloor,2\right)+ \textbf{i}\cdot \text{mod}\left(\bigg\lfloor\frac{n+1}{2}\bigg\rfloor,2\right)\cdot \textbf{i}$

References:[1]-A133872-Period 4: repeat 1,1,0,0. The On-Line Encyclopedia of Integer Sequences!