-1

I recently watched a video on Pisano periods on Fibonacci series where you calculate each term of the sequence mod $m$ and you will find that it has a periodic pattern for any $m$. After this I tried different sequences such as the triangular numbers as well as normal arithmetic and geometric sequences and found that they are also periodic mod $m$.

I'm interested in knowing if all sequences are periodic and if not then what is the criteria for a sequence to be periodic mod $m$.

IShotMyCat
  • 41
  • 4
  • 4
    Take any non-periodic sequence of zeroes and ones. Then it will never be periodic mod any $m$. – Anthony Jul 22 '22 at 20:15
  • @AnthonySaint-Criq Well, it will be periodic mod $1$ ... :P – Noah Schweber Jul 22 '22 at 20:18
  • @Anthony Saint-Criq Yea that is definitely one counter example but I rather think about sequences that follow some rule like the Fibonacci and triangular numbers – IShotMyCat Jul 22 '22 at 20:20
  • 3
    What do you mean by "rule"? Is being consecutive binary digits of $\sqrt 2$ or $\pi$ a "rule"? – tomasz Jul 22 '22 at 20:23
  • @tomasz A formula that they follow, like the Fibonacci sequences follows a recursive formula and the triangular numbers have a formula as well. – IShotMyCat Jul 22 '22 at 20:25
  • 2
    Well, the consecutive binary digits of $\sqrt 2$ are given by the formula $\lfloor 2^{n+1}\sqrt 2\rfloor -2\lfloor 2^n\sqrt 2\rfloor$. – tomasz Jul 22 '22 at 20:27
  • @tomasz I don't really know how to define what I'm asking rigorously cause I don't really have too much math knowledge all I can really do is give you examples of what I mean. But no I don't consider that sequence allowed since it includes rounding. Main examples are Fibonacci, triangular numbers, arithmetic sequences and geometric sequences where all the terms are integers. – IShotMyCat Jul 22 '22 at 20:31
  • 1
    All sequences follow a formula, even if a half-assed one. For instance,

    $$1,4,3,6,9,10,\cdots$$

    can be generated by

    $$a_n = \begin{cases} 1 & n = 1 \ 4 & n= 2\ 3 & n = 3 \ 6 & n = 4 \ 9 & n = 5 \ 10 & n = 6 \ \vdots \end{cases}$$

    There is nothing deep hidden in this sequence, it is simply a random sequence of numbers I made up. The same is true of many sequences. Some just have nicer definitions than others; others are defined piecemeal. And there's probably no meaningful way to distinguish between them.

    – PrincessEev Jul 22 '22 at 20:35
  • @EeveeTrainer: "all sequences follow a formula"... that depends on your definition of "formula". Assuming anything even close to "algorithm", it would require some sort of finite specification, and there are more sequences than there are possible finite formulas. – Arturo Magidin Jul 22 '22 at 20:53
  • @EeveeTrainer The sequence you gave if only given a finite amount of terms could still be given by some formula. The sequences I'd like to consider are those where you have that $a_n$ is equal to Some expression involving $n$ or any previous term where only basic operations are used such as addition, subtraction, multiplication, division, powers and etc. – IShotMyCat Jul 22 '22 at 20:54
  • 1
    Any sequence obeying a recurrence $a_{n+1} = f(a_n, a_{n-1}, \ldots, a_{n-k+1})$, with all $a_i$ in some finite set $S$ will eventually be periodic. The reason: At some point you must have a tuple of $k$ elements in a row that exactly matches a previous such tuple, since there are only finitely many $k$-tuples possible. At that point the next elements after each tuple must also match, since they are determined by $f$, and so on inductively. – Jair Taylor Jul 22 '22 at 21:10
  • 1
    If the $a_i$ are not restricted to a finite set, but $f(x_1, \ldots, a_k) \pmod m$ depends only on the values of $a_1 \pmod m, \ldots, a_k \pmod m$, then by the previous argument, $a_n \pmod m$ will eventually be periodic. – Jair Taylor Jul 22 '22 at 21:11
  • See the links here on reinventing the wheel (cycle). – Bill Dubuque Jul 22 '22 at 21:11

1 Answers1

4

As indicated by the comments, it depends on how the sequence is defined.

One exception will be the digits, base $m$, of an irrational number, e.g. $\sqrt 2$ or $\pi$.

Another would be a random sequence e.g. generated by a coin or dice toss.

However if, like the Fibonacci sequence, the next value is determined by a finite number of preceding values then it will be periodic. In the Fibonacci example, the next value is determined by the current and previous one then there at most $m^2$ possible states and hence it must become periodic within this limit.

One of my own previous questions is on this topic.

Fibonacci sequence in $\mathbb{Z}_5$

Clarification

My periodic case assumes:

  • The values are from a finte set e.g. $\mathbb{Z}_m$

  • The next value is determined solely by the current value and a fixed number of preceding values. So, $a_{n+1}$ is a function of $a_n, a_{n-1}, ..., a_{n-k+1}$ for a fixed $k$.

  • The position in the sequence $n$ is not available to the function.

Although the sequence will eventually return to a previous state and then become periodic, it might go through some initial states which are not repeated. It will be rather like the decimal expansion of a rational number. There will be degenerate cases in which the period is $1$. The sequence enters a state and get stuck there. A simple example is a Fibonacci like sequence with the initial values $0, 0$.

In some cases, including the Fibonacci sequence, the relationship will be reversible. I mean that you can calculate the previous value from a finite numberof values. For Fibonacci:

$$a_{n-1} = a_{n+1} - a_n$$

In these cases, the sequence will return to its initial state and be periodic without needing to ignore a prefix.

badjohn
  • 8,204
  • 1
    Beware of which exact definition of "next value determined by preceding values" is used because the Thue-Morse sequence is non-periodic and $t_{2n},t_{2n+1}$ only depend on $t_n$. – zwim Jul 23 '22 at 01:00
  • @zwim Thanks. I'll read up on that and update my answer appropriately. – badjohn Jul 23 '22 at 07:09
  • 1
    Additionally, such a sequence that you describe need not be truly periodic (there's no guarantee of revisiting the initial conditions that started the sequence), but it will always be eventually periodic: that is, there will be some $N$ such that $(a_n)_{n \geq N}$ is periodic. (and as another interesting criterion, the position $n$ may not be available to the function, but the value $n \pmod K$ can be available for a fixed $K$) – Brian Moehring Jul 23 '22 at 21:17
  • @BrianMoehring A good point that it will not necessarily return to its initial state. I'll make another update. I am not sure that I follow your second point. I am tired now, I'll check again in the morning. – badjohn Jul 23 '22 at 21:29