FindTransientRepeat[list,n]
返回一对列表 {transient,repeat},其中在 list 的 transient 部分元素后面,repeat 的元素连续出现至少 n 次.
FindTransientRepeat[string,n]
返回字符串对 {transient,repeat}.
FindTransientRepeat
FindTransientRepeat[list,n]
返回一对列表 {transient,repeat},其中在 list 的 transient 部分元素后面,repeat 的元素连续出现至少 n 次.
FindTransientRepeat[string,n]
返回字符串对 {transient,repeat}.
更多信息和选项
- 在 FindTransientRepeat[list,n] 中,n 必须是一个正整数.
- FindTransientRepeat[list,1] 返回 {{},repeat},其中 repeat 是 list 中最短的重复,或没有在 list 中找到重复的部分.
- FindTransientRepeat[list,n,SameTest->test] 应用 test 于 list 中的每一对元素,以判断它们是否可视为相同的.
范例
打开所有单元 关闭所有单元基本范例 (2)
FindTransientRepeat[{1, 2, 1, 2, 1, 2}, 3]FindTransientRepeat[{RGBColor[1, 1, 0], RGBColor[0, 0, 1], RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[1, 0, 0], RGBColor[0, 1, 0]}, 2]FindTransientRepeat["abcdedede", 2]范围 (4)
FindTransientRepeat[{a, b, a, b, a, b}, 3]FindTransientRepeat[{1, 2, 3, 4, 3, 4, 3, 4}, 3]FindTransientRepeat[{1, 2, 3, 4, 3, 4, 3, 4}, 3]FindTransientRepeat[{1, 2, 3, 4, 3, 4, 3, 4}, 4]FindTransientRepeat 的第一个参数的元素可以有不同的头部:
FindTransientRepeat[{1, "a", RGBColor[0, 0, 1], f[x], {}, RGBColor[0, 0, 1], f[x], {}}, 2]FindTransientRepeat 接受 SparseArray 和结构化数组对象:
sa = SparseArray[{1 -> 1, 4 -> 1, 7 -> 1, 10 -> 1}, 12];
FindTransientRepeat[sa, 2]qa = QuantityArray[{1.5, 3., 8, 7, 9., 7, 9., 7, 9.}, "Meters"];
FindTransientRepeat[qa, 2]推广和延伸 (1)
FindTransientRepeat 可以在最后一个位置检测重复子列表的不完整副本:
FindTransientRepeat[{a, b, c, a, b, c, a, b}, 2]FindTransientRepeat[{a, b, c, a, b}, 2]选项 (3)
SameTest (3)
FindTransientRepeat[{1, 2, -3, 4, 3, -4, -3, 4}, 3, SameTest -> (Abs[#1] == Abs[#2]&)]基于 Floor 使用相等的类别:
FindTransientRepeat[{1, 2, 3, 4.1, 3.2, 4.5, 3., 4.4}, 3, SameTest -> (Floor[#1] == Floor[#2]&)]使用列表元素的 Total:
FindTransientRepeat[{{1, 2}, {3, 4}, {6, 1}, {0, 7}, {5, 2}}, 3, SameTest -> (Total[#1] == Total[#2]&)]应用 (7)
恢复 StringRepeat 表达式的生成元:
n = 10;
s = StringRepeat["hello", n]FindTransientRepeat[s, n]list = {{}, {a}, {a, a}, {a, a, a}, {a, a, a, a}, {a, a, a, a, a}};
Select[list, FindTransientRepeat[#, 3] === {{}, {a}}&]与 Repeated 比较:
Cases[list, {Repeated[a, 3]}]min = 0;max = 8π;
step = π / 6;
ftr = FindTransientRepeat[Sin /@ Range[min, max, step], 3]Length[Last[ftr]] * step与 FunctionPeriod 比较:
FunctionPeriod[Sin[x], x]x = (Sqrt[12] + 2) / 7;
QuadraticIrrationalQ[x]ContinuedFraction[x, 50]FindTransientRepeat[%, 2]r = 11 / 7;
RealDigits[r]FindTransientRepeat[ToString[N[r, 40]], 2]ca = CellularAutomaton[60, {0, 0, 0, 1, 0, 0, 0}, 20];
ArrayPlot[ca]ftr = FindTransientRepeat[ca, 2];
ArrayPlot[Last[ftr], ImageSize -> Tiny]Table[Length[Last[FindTransientRepeat[CellularAutomaton[90, Prepend[Table[0, n], 1], 10000], 10]]], {n, 20}]属性和关系 (4)
当不存在重复部分,FindTransientRepeat 返回第一个参数和空列表:
FindTransientRepeat[{1, 2, 3, 4, 5}, 2]当没有重复部分满足出现次数条件时,FindTransientRepeat 返回第一个参数和空列表:
FindTransientRepeat[{1, 2, 3, 4, 3, 4}, 3]FindTransientRepeat 返回子列表对 {transient,repeat},其中 transient 具有最小长度:
FindTransientRepeat[{1, 2, 3, 4, 4, 4, 3, 4, 4, 4}, 2]FindTransientRepeat[{1, 2, 3, 4, 4, 4, 3, 4, 4, 4}, 3]FindTransientRepeat 找出表达式的过渡部分和重复部分:
FindTransientRepeat[{a, b, 1, 2, 1, 2, 1, 2}, 2]FindRepeat 处理一个周期表达式:
FindRepeat[{a, b, 1, 2, 1, 2, 1, 2}, 2]FindRepeat[{1, 2, 1, 2, 1, 2}, 2]如果一个表达式没有过渡部分,FindRepeat[expr,n] 等同于 Last[FindTransientRepeat[expr,n]]:
expr = "abcabcabc"rep = FindRepeat[expr, 2]trep = FindTransientRepeat[expr, 2]rep === Last[trep]文本
Wolfram Research (2016),FindTransientRepeat,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FindTransientRepeat.html.
CMS
Wolfram 语言. 2016. "FindTransientRepeat." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/FindTransientRepeat.html.
APA
Wolfram 语言. (2016). FindTransientRepeat. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FindTransientRepeat.html 年
BibTeX
@misc{reference.wolfram_2026_findtransientrepeat, author="Wolfram Research", title="{FindTransientRepeat}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/FindTransientRepeat.html}", note=[Accessed: 02-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_findtransientrepeat, organization={Wolfram Research}, title={FindTransientRepeat}, year={2016}, url={https://reference.wolfram.com/language/ref/FindTransientRepeat.html}, note=[Accessed: 02-November-2026]}