# For the periodic sequence, is there always an algebraic closed form?

This question is a generalized form of the problem I asked before:

Algebraic Closed Form for $$\sum_{n=1}^{k}\left( n- 3 \lfloor \frac{n-1}{3} \rfloor\right)$$

Let, look at this periodic sequence:

$$a_n=\left\{a_1,a_2,a_3,a_4,a_5,\cdots a_k ; a_1,a_2,a_3,a_4,a_5, \cdots a_k; a_1,a_2,a_3,a_4,a_5,\cdots a_k;\cdots \right\}$$, where $$\left\{a_1, a_2, a_3, \cdots a_k \right\} \in \mathbb{Z^{+}}$$ and $$a_{k+1}=a_1, a_{k+2}=a_2, a_{k+3}=a_3, \cdots a_{2k}=a_k, \cdots$$

For the sequence $$a_k=\left\{ a_1,a_2,a_3,...,a_k \right\}$$ , $$k$$ is a finite number. $$a_1,a_2,...a_k$$ are arbitary numbers.

Verbally, the series $$a_n$$ consists of an infinite number of periodic repetitions of the finite series $$a_k.$$

Finally my question is:

a) If there is an exist a algebraic closed form, for finite series $$a_k$$, in this case, does the $$a_n$$ series always have a algebraic closed form?

b) If there is not an exist a algebraic closed form, for finite series $$a_k$$, in this case, does the $$a_n$$ series always have a algebraic closed form?

I mean ,for example:

a)

$$a_n=\left\{ 1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7\cdots\right\}$$

b)

$$a_n=\left\{1,8,2,6,5,9,1,8,2,6,5,9,1,8,2,6,5,9,1,8,2,6,5,9\cdots\right\}$$

Thank you very much.

• A finite sequence always does have a closed form, and so does a periodic sequence. – Robert Israel Jan 8 at 12:39
• @RobertIsrael for any arbitary numbers for $a_1, a_2,a_3,...a_k$, There's an always closed form for $a_n$. Do I understand correct? – Elementary Jan 8 at 12:46
• @Beginner, it depends on what you consider a "closed form". That term is not really well-defined. In a sense you have given a "closed form" in your definition of the sequence. – Mees de Vries Jan 8 at 12:53
• @MeesdeVries I tried to give 2 example for a good understanding of the question.. – Elementary Jan 8 at 12:56
• This might be a closed form for your first sequence: $$a_k = \begin{cases} 1&\text{if k = 1 \mod4,}\\ 3&\text{if k = 2 \mod4,}\\ 5&\text{if k = 3 \mod4,}\\ 7&\text{else.} \end{cases}$$ Does that satisfy what you're looking for in a "closed form"? – Mees de Vries Jan 8 at 13:08

A periodic sequence with period $$P$$ can always be written as a trigonometric polynomial $$a_n = \sum_{j=0}^{P-1} b_j \cos(2 \pi j n/P) + \sum_{j=1}^{P-1} c_j \sin(2 \pi j n/P)$$ for some coefficients $$b_j$$ and $$c_j$$ (look up Finite Fourier Transform).
Thus your first example can be written as $$a_n = 4-\cos \left( \pi\,j/2 \right) -\cos \left( \pi\,j \right) -\cos \left( 3\,\pi\,j/2 \right) -\sin \left( \pi\,j/2 \right) +\sin \left( 3\,\pi\,j/2 \right)$$
Let $$f(x)$$ be a polynomial interpolating $$a_1,a_2,a_3,\dots,a_k$$.
Then the sequence is given by $$a_n = f(1+((n-1) \bmod k))$$.
If you can't use mod directly, but can use floor, then note that $$a \bmod b = a - b \left\lfloor \dfrac{a}{b} \right\rfloor$$ for $$a,b \in \mathbb N$$.