Given the first $5$ elements of a binary sequence $x_1 = 0, x_2 = 1, x_3 = 0, x_4 = 0, x_5 = 0$, the subsequent ones are determined as follows:
$$x_{n + 5} = x_{n} + x_{n + 2}$$
(this is an example of Linear Feedback Shift Register).
So,
$$01000010010110 \ldots$$
This sequence is periodic after $31$ elements. How is it possible to prove this?
$31 = 2^5 - 1$ and it can be related to the number of the first assigned elements $x_1, \ldots, x_5$.
I tried to expand the single items $x_i$ as a combination of the first $5$ items till no. $18$, with nothing relevant, except the fact that each $x_i$ can always be expressed as
$$x_i = a_1 x_1 + a_2 x_2 + a_3 x_3 + a_4 x_4 + a_5 x_5$$
where $a_i$ are integer coefficients.
Is this the right appoach to determine the periodicity of the sequence, or other ones are preferable?
The simple way to prove it is to compute the first $36$ terms and show that $01000$ recurs starting at position $32$ and not before. As the length of the recurrence is $5$ the behavior is determined by five successive terms and you are done. You can do the computation in a spreadsheet computing one term, then copy down for all the rest of the terms.