A329316 Irregular triangle read by rows where row n gives the sequence of lengths of components of the Lyndon factorization of the reversed first n terms of A000002.
1, 1, 1, 1, 1, 1, 3, 1, 4, 1, 1, 4, 1, 2, 4, 1, 1, 2, 4, 1, 1, 1, 2, 4, 1, 3, 2, 4, 1, 1, 3, 2, 4, 1, 1, 1, 3, 2, 4, 1, 3, 3, 2, 4, 1, 9, 4, 1, 1, 9, 4, 1, 2, 9, 4, 1, 16, 1, 1, 16, 1, 1, 1, 16, 1, 3, 16, 1, 1, 3, 16, 1, 5, 16, 1, 6, 16, 1, 1, 6, 16, 1, 2, 6
Offset: 0
Examples
Triangle begins: 1: (1) 2: (1,1) 3: (1,1,1) 4: (3,1) 5: (4,1) 6: (1,4,1) 7: (2,4,1) 8: (1,2,4,1) 9: (1,1,2,4,1) 10: (3,2,4,1) 11: (1,3,2,4,1) 12: (1,1,3,2,4,1) 13: (3,3,2,4,1) 14: (9,4,1) 15: (1,9,4,1) 16: (2,9,4,1) 17: (16,1) 18: (1,16,1) 19: (1,1,16,1) 20: (3,16,1) For example, the reversed first 13 terms of A000002 are (1221221211221), with Lyndon factorization (122)(122)(12)(1122)(1), so row 13 is (3,3,2,4,1).
Crossrefs
Programs
-
Mathematica
lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And]; lynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[lynfac[Drop[q,i]],Take[q,i]]][Last[Select[Range[Length[q]],lynQ[Take[q,#]]&]]]]; kolagrow[q_]:=If[Length[q]<2,Take[{1,2},Length[q]+1],Append[q,Switch[{q[[Length[Split[q]]]],q[[-2]],Last[q]},{1,1,1},0,{1,1,2},1,{1,2,1},2,{1,2,2},0,{2,1,1},2,{2,1,2},2,{2,2,1},1,{2,2,2},1]]] kol[n_Integer]:=Nest[kolagrow,{1},n-1]; Table[Length/@lynfac[Reverse[kol[n]]],{n,100}]
Comments