3

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?

john1672
  • 183
  • 2
    One way you could do this is compute the first 10004 terms. By then, you are guaranteed to see a sequence of four consecutive numbers that repeats, which will result in the sequence being periodic. – Theo Bendit Aug 16 '18 at 12:38
  • 3
    @mfl It's just pigeonhole principle, right? If you compute 10004 terms, then that's 10001 sequences of four digits, of which there are only 10000 possibilities. Therefore, there must be the same four digits appearing twice in the sequence, and after that, the sequence must repeat. – Theo Bendit Aug 16 '18 at 12:45
  • @mfl Sorry, I didn't mean that the one four digit sequence would repeat, but that the sequence would have some kind of (potentially very long) period. – Theo Bendit Aug 16 '18 at 12:57
  • No problem. I imaginated that. – mfl Aug 16 '18 at 13:02
  • I asked a similar problem yesterday, Here's the link – prog_SAHIL Aug 16 '18 at 13:11

2 Answers2

4

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.

Pjotr5
  • 2,187
  • 1
  • 13
  • 17
  • In fact the rule is easily seen to be reversible, so no matter what you start, the cycle you end up with must contain the sequence you started at. – hmakholm left over Monica Aug 16 '18 at 12:54
  • 1
    @HenningMakholm Caution! The sequence starts with 2018, but the OP is asking for the pattern 2019 to appear. I initially made this mistake too. – Pjotr5 Aug 16 '18 at 12:55
  • 1
    x @Pjotr5: I was going by the title of the question. I agree that the mod-2 argument shows that starting with 2,0,1,8 cannot lead to 2,0,1,9. – hmakholm left over Monica Aug 16 '18 at 12:56
1

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.

awkward
  • 14,736