7

Some formulae for a periodic sequence?


when $T = 2$, we have $-1,1,-1,1,-1,1,\text{...}$, the formula is

$$\begin{align*}(-1)^n\end{align*}$$

when $T = 4$, we have $-1,-1,1,1,-1,-1,1,1\text{...}$, the formula is?

And how about the case $T=k$?

Sequence
  • 135
  • 5

3 Answers3

3

The clearest is $a_n=-1$ if $n$ leaves remainder $1$ or $2$ on division by $4$, and $a_n=1$ otherwise.

There are also conventionally "closed form" formulas, such as $$a_n=\sqrt{2}\cos\left(\frac{(2n+1)\pi}{4}\right).$$

André Nicolas
  • 507,029
  • This is good, is it have relations with the form in Dan's answer? – Sequence Sep 03 '13 at 06:44
  • Well, they give the same sequence, that's about it. – André Nicolas Sep 03 '13 at 06:47
  • Yes, that's a wonderful thing in math. – Sequence Sep 03 '13 at 06:49
  • Hi, how about the case $k=3$?, it's not $\sqrt{3} \cos \left(\frac{1}{6} \pi (3 n+1)\right)$ – Sequence Sep 04 '13 at 02:51
  • When $n=3$, the formula in my answer yields $\sqrt{2}\cos(7\pi/4)$, which is $1$, exactly as your sequence asks for. The $\sqrt{3}\cos(\frac{1}{6}\pi(3n+1))$ has no connection with the formula that I gave. – André Nicolas Sep 04 '13 at 02:56
  • when k=3, the sequence is $-1,-1,-1,1,1,1,-1,-1,-1,...$, I just guessed one, – Sequence Sep 04 '13 at 03:00
  • I just noticed that your question also asked for the general case $k$. For that, a roots of unity approach is probably best. We have the recurrence $a_{n+k}=-a_n$, with initial conditions $a_1=a_2=\cdots=a_k$. The standard characteristic equation approach to this recurrence tells us there is a solution which is a linear combination of terms of the kind $e^{i\pi n j /(2k}$. This can be in principle expressed in terms of sines and cosines. I could come up with a specific formula for say $k=3$ or $4$. – André Nicolas Sep 04 '13 at 03:12
3

Use discrete Fourier transform.

It is a general fact that every periodic sequence $(x_n)$ of period $T$ is in the linear span of the sequences $\{e^T_k\,;\,1\leqslant k\leqslant T\}$, where, for every $n$, $$ (e_k^T)_n=\mathrm e^{2\mathrm i \pi nk/T}. $$ That is, there exists $(a_k)_{1\leqslant k\leqslant T}$ such that, for every $n$, $$ x_n=\sum_{k=1}^Ta_k(e_k^T)_n=\sum_{k=1}^Ta_k\mathrm e^{2\mathrm i \pi nk/T}. $$ To find $(a_k)_{1\leqslant k\leqslant T}$, one considers the equations above over one period, say for $1\leqslant n\leqslant T$, as a Cràmer system with unknowns $(a_k)_{1\leqslant k\leqslant T}$.


Example: Consider some sequence $x=(x_1,x_2,x_3,x_1,x_2,x_3,\ldots)$, then $T=3$, $$ e_1^3=(j,j^2,1,j,j^2,1,\ldots),\quad e^3_2=(j^2,j,1,j^2,j,1,\ldots),\qquad e^3_3=(1,1,1,1,1,1,\ldots), $$ with $j=\mathrm e^{2\mathrm i\pi/3}$, and one looks for $(a_1,a_2,a_3)$ such that $x=a_1e^3_1+a_2e^3_2+a_3e^3_3$, that is, $$ x_1=a_1j+a_2j^2+a_3,\quad x_2=a_1j^2+a_2j+a_3,\quad x_3=a_1+a_2+a_3. $$ Thus, $$ 3a_1=j^2x_1+jx_2+x_3,\quad 3a_2=jx_1+j^2x_2+x_3,\quad 3a_3=x_1+x_2+x_3, $$ which yields $x_n$ as a linear combination of $j^n$, $j^{2n}$ and $1$, namely, for every $n$, $$ x_n=a_1j^n+a_2j^{2n}+a_3. $$

Did
  • 279,727
2

You can write it as $(-1)^{\large \lfloor \frac{2 \cdot n+T-2}{T} \rfloor}$.

If you defined things a bit differently (start counting from zero, parameterize the half period instead of the full period) you could just write $(-1)^{\large \lfloor \frac{n}{T} \rfloor}$.

Dan Brumleve
  • 17,796
  • But why? ${}{}{}{}$ – Pedro Sep 03 '13 at 02:26
  • hi, I would also like to know a little about why and how to obtain the formula, I've thought something about Mod, Ceiling and Floor. This is good, is it have some relations with the form in Andre's answer? – Sequence Sep 03 '13 at 06:44
  • One intuition is that you can associate raising $-1$ to a power with "alternating" and associate the floor function with "doubling", "tripling", etc. You can find the relationship between the answers in the Taylor series for cosine. – Dan Brumleve Sep 03 '13 at 06:49