Concept stop · What is it?

Periodic Sequences

In the Chinese book: 周期数列

When finitely many states decide the next term, a state repeats and it cycles.

Before this stop, visit:Recursive Sequences (Skill)

Hands first, words secondStep forward one term at a time. The small grid records each pair of neighboring terms (aₙ, aₙ₊₁). At which term does a pair first appear that has appeared before? What happens after that?

Loading figure…

Try this

  1. 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?
  2. 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.
  3. Set to and to . Is the pair that repeats this time the first pair? (Look at “Tail length ”.)
  4. 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 ?

Choose an answer first; then you can see the result.

Why

Theorem: an integer linear recurrence is always periodic mod m

Step 1 / 4
Loading figure…
  1. 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)

, , and . Press “Run to the first repeat”: the pair that repeats is exactly the first pair, .

Loading figure…

Practice

Exercise 1Basic

. Find the sum of the first terms.

Exercise 2Basic

What is the last digit of ?

Exercise 3Advanced

. What is the least positive period of the sequence mod ?

Exercise 4Challenge

. Find .

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Combining two periods and thinking only of the least common multiple

The wrong step: A sequence has period and also period , so its least positive period is .
What went wrong? Think first, then open

Diagnosis is certainly a period, but it is not the least one. From and we get (go forward , then back ). So is a period too. In general, the greatest common divisor of two periods is also a period (by Bézout's identity, ).

The right step: Periods can be “subtracted”: is a period. Whether the least positive period is or depends on the sequence itself. Also, every period is a multiple of the least positive period.

“Periods can be subtracted, so look at the greatest common divisor”