First four numbers of a sequence are $2,0,1,8,$. Each next is the last digit of the sum of the preceding four numbers. Will $2,0,1,8$ show up again?

155 Views Asked by At

Let $a_n$ is a sequence of numbers. The firs four numbers are $2,0,1,8$ and each following number is the last digit of the sum of the preceding four numbers. The first ten numbers are $2,0,1,8,1,0,0,9,0,9$. Will the succession $2,0,1,8$ show up again? Will the succession $2,0,1,9$ show in this sequence of numbers?

I couldn't do more.

$2+0+1+8=11$, $\enspace$ $11 \enspace mod \enspace 10=1$,$\enspace$ $a_5=1$

$a_n=(a_{n-1}+a_{n-2}+a_{n-3}+a_{n-4})\enspace mod\enspace10$

Could someone give me an idea?

2

There are 2 best solutions below

3
On

The answer to the title is yes. The answer to your other question is no.

With a little help of the computer we find that the sequence $a_n \pmod{2}$ has period 5 and the sequence $a_n \pmod{5}$ has period $312$. This means that the sequence $a_n \pmod{10}$ has period $\text{lcm}(5,312) = 1560$. This means that we only have to consider the first $1560$ terms to see if the pattern 2 0 1 9 shows up. A computer search confirms that it does not. This also means that the pattern 2 0 1 8 will reappear after 1560 terms.

In fact we can do much better to exclude 2 0 1 9 appearing. Since, for the pattern 2 0 1 9 to appear, the pattern 0 0 1 1 must appear in the sequence modulo $2$. We saw that this sequence has period $5$ and it is very easy to confirm that 0 0 1 1 does not appear in the first couple of terms.

As a final comment I will add that we did not need to use the computer to confirm that 2 0 1 8 will reappear because a linear recurrence over a finite abelian group like $\mathbb{Z}/10\mathbb{Z}$ must necessarily have some period. As others have mentioned in the comments. So actually both questions can be answered without the use of much computing power.

0
On

Notice that given any four sequential numbers in the sequence, say $a_n, a_{n+1}, a_{n+2}, a_{n+3}$ with $n>1$, $a_{n-1}$ is determined uniquely; in fact, $a_{n-1} = a_{n+3} - a_{n+2} - a_{n+1} - a_{n} \bmod 10$.

Since there are only finitely many four-tuples of the digits $0-9$, the sequence of four-tuples must eventually repeat. That is, there are $m$ and $n$ with $m<n$ and $a_{m+i} = a_{n+i}$ for $i = 0,1,2,3$. Let $k$ be the least such $m$. We claim $k=1$. If not, we must have $a_{k+i} = a_{n+i}$ for $i = -1, 0, 1, 2$, contradicting the minimality of $k$. This shows that the sequence eventually produces $2,0,1,8$ again.

On the other hand, the sequence will never produce $2,0,1,9$ because modulo $2$ the sequence $0,0,1,0,1$ repeats indefinitely, so two odd digits can never appear in succession.