TITLE: String formed by the sum of the last four elements mod 10
QUESTION [7 upvotes]: Example of a string:
$1, 5, 1, 9, \color{red}{6}, 1, 7, 3, 7, \color{red}8, 5, 3, 3, 9, \color{red}0, 5, 7, 1, 3, \color{red}6, 7, 7, 3, 3, \color{red}0,\dots$
The first $4$ elements are random. Every next one is the sum of the previous four mod 10.
What I have noticed is that every fifth element, which happens to be always even, put together with the others even elements in a separate string in the same order follow the same principle. 
Every fifth element, from the string above, forms the string beginning with $6, 8, 0, 6, 0,\dots$  Observe that $0$ is exactly the sum of the last four ones mod 10. 
All I want to figure out is why those elements follow the same principle. I tried to make a proof for 2 days and I couldn't. If anyone has any idea that will be great. Thanks in advance!

REPLY [2 votes]: One way to look at this is that it's LINEAR: if you take two sequences created using the rule, and you add them (mod 10), you get a new sequence that follows the rule. The same goes if you multiply by a constant (and reduce mod 10). So if we look at and understand some very basic sequences, like
$$
s_1 = 1, 0, 0, 0, \ldots\\
s_2 = 0, 1, 0, 0, \ldots\\
s_3 = 0, 0, 1, 0, \ldots\\
s_4 = 0, 0, 0, 1, \ldots
$$
then we can understand a sequence like yours, because it's just 
$$
s = 1 * s_1 + 5 * s_2 + 1 * s_3 + 9 * s_4
$$
@Vepir has already analyzed $s_4$ to show that it produces a sequence that does not have the special property (although the analysis is flawed, the conclusion is correct). Let's look at the others:
$$
s_1 = 1 ,    0,     0,     0,     {\bf 1},     1,     2,     4,     8,     {\bf 5},     9,     6,     8,     8,
{\bf     1},     3,     0,     2,     6, {\bf     1},     9,     8,     4,     2,    {\bf  3}
$$
for which the sum of first four bold values is $8$, but should be $3$. We'll call this a "sum error" of $5$.  
$$
s_2 = 0,     1,     0,     0,     1,     2,     3,     6,     2,     3,     4,     5,     4,     6,
     9,     4,     3,     2,     8,     7,     0,     7,     2,     6,     5\\
s_3 =  0,     0,     1,     0,     1,     2,     4,     7,     4,     7,     2,     0,     3,     2,
,    7,     2,     4,     5,     8,     9,     6,     8,     1,     4,     9\\
s_4 = 0,     0,     0,     1,     1,     2,     4,     8,     5,     9,     6,     8,     8 ,    1, 3,     0,     2,     6,     1,     9,     8,     4,     2,     3,     7
$$
The corresponding sum-errors (for the 'every fifth element' subsequences) are all also
$5$. 
So why does your sequence end up with a sum-error of zero? Because the error will be $1 * 5 + 5 * 5 + 1 * 5 + 9 * 5 \bmod 10$, which is $16 * 5 \bmod 10 = 80 \bmod 10 = 0$. 
Indeed, for any sequence formed as a combination of my four basic sequences, if the first four items do add up to an even number, then the sum-errors will add up to an even number times $5$, which taken mod $10$ gives zero. If they do not add up to an even number, then the every-fifth-element subsequence will not have the desired property.