What is the best way to find the period of a (repeating) list in Mathematica?

前端 未结 9 1385
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 15:12

What is the best way to find the period in a repeating list?

For example:

a = {4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2}

has repeat

9条回答
  •  遥遥无期
    2021-01-01 16:04

    This sounds like it might relate to sequence alignment. These algorithms are well studied, and might already be implemented in mathematica.

提交回复
热议问题