Try this
- Step forward one term at a time and watch the small grid next to the clock. There are only possible pairs of neighboring terms . Can the sequence go on forever without repeating?
- When you reach the first repeated pair, what should happen next, in principle? Take a few more steps (or press “Run to the first repeat”) to check.
- Set to and to . Is the pair that repeats this time the first pair? (Look at “Tail length ”.)
- Now set to . The tail disappears. What role does it play whether and are coprime?
If there are positive integers and such that for every , then is called a periodic sequence and is a period of it. If (it cycles from the very start), it is called purely periodic. The smallest such is the least positive period. A sequence of integers need not be periodic itself, but its remainders mod often are: it is then called periodic mod .
Predict first
The sequence . What is ?
Write out a few terms: Terms and are again, and from then on everything repeats, with period . , so .
In fact you can see it without writing anything: gives , so . As the previous stop said, its characteristic roots are unit complex numbers that turn by , and six turns bring them back to the start.
Why
Theorem: an integer linear recurrence is always periodic mod m
Step 1 / 4- States
. The next term depends only on the two before it, so the pair of neighboring terms is the state of the sequence: once you know it, everything after it is determined.
The same argument works for any sequence in which “the next term is determined by the previous terms, and each term takes only finitely many values”: there are finitely many states, so sooner or later one repeats, and after the repeat the sequence cycles.
Remove one condition
Break it
Counterexample lab: remove one condition
Conclusion: The sequence is purely periodic mod (it cycles from the very first term) ← still true?
, , and . Press “Run to the first repeat”: the pair that repeats is exactly the first pair, .
Change only the to a : , where .
The first two terms never come back; the cycle only starts at : , . Because loses information mod (), running backwards is not unique: the state can have two different predecessors. The sequence is still periodic, but no longer purely periodic.
Practice
. Find the sum of the first terms.
What is the last digit of ?
. What is the least positive period of the sequence mod ?
. Find .