1

**The number sequence $1,9,8,2...$ is defined so that $t_n$ is the last digit of $t_{n-1}+t_{n-2}+t_{n-3}+t_{n-4}$ for $n>4$

Will the numbers $3,0,4,4$ ever occur in the sequence order?

To examine this I first noted that if we continue the rule forward we get $3,0,4,4,1,9,8,2$

So we repeat the sequence from the start.

It is clear from the pigeon-hole principle that the sequence must repeat at some point. However, I am not sure how to prove that we do not hit some intermediate loop and therefore never return to the beginning?

aman
  • 1,294
  • For info here are the equivalence classes https://ctxt.io/2/AACgyen7Fw notice the little loops for seeds containing only ${0,5}$ and also two other shorter loops for seeds containing only ${0,2,4,6,8}$. The remaining is spread into $6$ other cycles of length $1560$. I was quite surprised that there are so few different lengths possible. – zwim Apr 07 '21 at 20:34
  • The reason there can be no preperiodic part is that the shift map is a permutation on a finite set so its orbits are cycles - see my answer in the linked dupe (this is essentially what the accepted answer is saying informally). See also my other answers on reinventing the wheel (cycle). – Bill Dubuque Apr 08 '21 at 12:29
  • 1
    @BillDubuque: I'm going to have to respectfully disagree with your gold-hammer closure here. Yes, you've written a good answer to the other question that describes a useful general result which can be used to solve both problems, and I've upvoted it. But the questions themselves are completely different and the general theorem in your answer is mixed with lots of details specific to that other question. If you'd like to post a brief answer here solving the problem using the fact that orbits of a permutation on a finite set are cycles, I'd upvote it too. – Ilmari Karonen Apr 09 '21 at 11:31
  • … Alternatively, maybe we ought to have a canonical question for something like "why does the sequence defined by a reversible recurrence on a finite set always loop back to its beginning?" – Ilmari Karonen Apr 09 '21 at 11:35
  • @Ilmari Yes, it'd be nice if we had a better canonical target, but we have have to work best with what exists - not what we dream might exist. It's unfortunate that your actions serve to further obscure this simple result that deserves to be much better known. Now students are once again left to reinvent the wheel (cycle) - a pedagogical disaster. As for abstract duplicates, this is not the correct place to argue that matter, but it is a crying shame that you are once again actively destroying the painstaking efforts of those who seek to organize the site. – Bill Dubuque Apr 09 '21 at 16:22
  • 1
    Well, the answer is "yes", but I just found it by brute force with a little python script. If $$t_0=1,t_1=9,t_2=8,t_3=2,$$ then $$t_{1556}=3,t_{1557}=0,t_{1558}=4,t_{1559}=4.$$ This is the first occurrence. – saulspatz Apr 07 '21 at 15:27
  • Thanks for verifying... However, it is a challenge problem in the book Mathematical Circles, which is an Olympiad book (this problem is from the part which doesn't have answers at the back) So I'm looking to see if it has some rigorous proof. – aman Apr 07 '21 at 15:39
  • Yes, I realize this isn't the kind of answer you're looking for. How do we know it doesn't get stuck in some other loop? I'm drawing a complete blank. – saulspatz Apr 07 '21 at 15:43
  • @RoddyMacPhee That doesn't seem to work. I have $t_6=t_5=t_1=9$ – saulspatz Apr 07 '21 at 16:21
  • you can get a reccurence that skips a few, when looking coeeficients of 1 in this case extend via: 1111 index n, 1222 index n+1, 2344 index n+2, 4678 index n+3, 8245 index n+4, 5379 index n+5, 9326 index n+6, . – Roddy MacPhee Apr 07 '21 at 23:13
  • Not an answer since the question asks for a proof, which the above is certainly not. Please post remarks like this as comments, not answers. – Bill Dubuque Apr 08 '21 at 14:01
  • @BillDubuque: Sure it's a proof. A very long (if you write out all 1557 steps) and thoroughly uninteresting proof, but a proof nonetheless. – Ilmari Karonen Apr 09 '21 at 11:16
  • @BillDubuque A brute force method always constitutes a proof Also, I always have admiration for people who do a bit of grunt work by writing a quick python script to verify a result :) – aman Apr 09 '21 at 13:53
  • @Ilmari That's absurd. Even ignoring matters of beauty or elegance, at the very least a proof must be comprehensible and verifiable. The above "answer" also fails on the latter account. Why should anyone believe the claim without any way to verify its correctness? (there might be a bug in the program). At the very least the program needs to be supplied so it can be verified by others. It's no better than claiming "I mentally proved that the first occurrence is ..." We should strive for higher standards for "answers". – Bill Dubuque Apr 10 '21 at 01:36
  • @aman Doesn't apply here, see above. – Bill Dubuque Apr 10 '21 at 01:40
  • @BillDubuque Well, so if he posted the code here and you checked it then it would be verified? Also, have you ever heard of the 4 colour map theorem? They proved it with the help of a computer. – aman Apr 10 '21 at 03:20
  • @aman We're here to help students learn math, and model how they can answer such questions in the future,, not turn to devices they don't understand to merely tell them "here's the answer". – amWhy May 15 '21 at 15:57
  • @amWhy I myself said that the computer proof was not what I was asking for. That being said, I appreciate the effort that went into it. Hope that clears it up. – aman May 16 '21 at 16:05
  • Glad to hear that, @aman. – amWhy May 16 '21 at 16:08
  • Note All of the above comments were migrated from a prior answer of saulspatz (which was converted to the (first) comment above). – Bill Dubuque May 16 '21 at 17:36

1 Answers1

6

The sequence is given by

$$t_n = t_{n-1}+t_{n-2}+t_{n-3}+t_{n-4} \pmod {10}$$

This allows you to calculate the sequence in the forward direction. You can however rewrite the above as

$$t_{n-4} = t_n - t_{n-1}-t_{n-2}-t_{n-3} \pmod {10}$$

With this you can go backwards in the sequence, too. For example the term before $1,9,8,2$ is $2-8-9-1\equiv 4 \bmod{10}$.

You know that the sequence repeats eventually, so for some positive integers $N$ and $p$ we have $t_{i}=t_{i+p}$ for all $i>N$. But now you can go backwards from both those points to get $t_{i-1}=t_{i-1+p}$. And then backwards again, and again until you arrive at $t_{0}=t_{p}$. So the sequence repeats from the beginning.

If you have a sequence which does not repeat from the start but from some later point, then that point will have two distinct predecessors - one from the starting point and one from the repeating loop. That is not possible in this case because we can travel backwards in the sequence, calculating the unique predecessor at each step.

  • Ah.... That was absolutely brilliant and obvious!! Thanks – aman Apr 07 '21 at 16:27
  • The uniqueness of the predecessor you developed in your comment above, is somehow missing in the final answer. I didn't catch it right away why it was impossible to branch to a local loop, so I think you should report it in here (and eventually delete the original comment). – zwim Apr 07 '21 at 20:26
  • 1
    @zwim That is essentially what is done in the last paragraph. By travelling backwards you have to come back to the beginning of the sequence as it is impossible to get into a loop before then. But I'll edit it to make it more explicit. – Jaap Scherphuis Apr 07 '21 at 20:46
  • @zwim As is often the case, this argument is reinventing the wheel (cycle). The reason there can be no preperiodic part is that the shift map is a permutation on a finite set so its orbits are cycles - see my answer in the linked dupe. – Bill Dubuque Apr 08 '21 at 12:31