A333940
Number of Lyndon factorizations of the k-th composition in standard order.
Original entry on oeis.org
1, 1, 1, 2, 1, 2, 1, 3, 1, 2, 2, 4, 1, 2, 1, 5, 1, 2, 2, 4, 1, 4, 2, 7, 1, 2, 1, 4, 1, 2, 1, 7, 1, 2, 2, 4, 2, 5, 2, 7, 1, 2, 3, 9, 2, 5, 2, 12, 1, 2, 1, 4, 1, 2, 2, 7, 1, 2, 1, 4, 1, 2, 1, 11, 1, 2, 2, 4, 2, 5, 2, 7, 1, 4, 4, 11, 2, 5, 2, 12, 1, 2, 2, 4, 1, 7
Offset: 0
We have a(300) = 5, because the 300th composition (3,2,1,3) has the following Lyndon factorizations:
((3,2,1,3))
((1,3),(3,2))
((2),(3,1,3))
((3),(2,1,3))
((2),(3),(1,3))
Binary necklaces are counted by
A000031.
Necklace compositions are counted by
A008965.
Necklaces covering an initial interval are counted by
A019536.
Lyndon compositions are counted by
A059966.
Numbers whose reversed binary expansion is a necklace are
A328595.
Numbers whose prime signature is a necklace are
A329138.
Length of Lyndon factorization of binary expansion is
A211100.
Length of co-Lyndon factorization of binary expansion is
A329312.
Length of co-Lyndon factorization of reversed binary expansion is
A329326.
Length of Lyndon factorization of reversed binary expansion is
A329313.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Co-Lyndon compositions are
A326774.
- Aperiodic compositions are
A328594.
- Reversed co-necklaces are
A328595.
- Length of Lyndon factorization is
A329312.
- Length of co-Lyndon factorization is
A334029.
- Combinatory separations are
A334030.
-
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
lynprod[]:={};lynprod[{},b_List]:=b;lynprod[a_List,{}]:=a;lynprod[a_List]:=a;
lynprod[{x_,a___},{y_,b___}]:=Switch[Ordering[If[x=!=y,{x,y},{lynprod[{a},{x,b}],lynprod[{x,a},{b}]}]],{2,1},Prepend[lynprod[{a},{y,b}],x],{1,2},Prepend[lynprod[{x,a},{b}],y]];
lynprod[a_List,b_List,c__List]:=lynprod[a,lynprod[b,c]];
sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
dealings[q_]:=Union[Function[ptn,Sort[q[[#]]&/@ptn]]/@sps[Range[Length[q]]]];
Table[Length[Select[dealings[stc[n]],lynprod@@#==stc[n]&]],{n,0,100}]
A329324
Number of Lyndon compositions of n whose reverse is not a co-Lyndon composition.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 2, 7, 16, 37, 76, 166, 328, 669, 1326, 2626, 5138, 10104, 19680, 38442, 74822, 145715, 283424, 551721, 1073224
Offset: 1
The a(6) = 1 through a(9) = 16 compositions:
(132) (142) (143) (153)
(1132) (152) (162)
(1142) (243)
(1232) (1143)
(1322) (1152)
(11132) (1242)
(11312) (1332)
(1422)
(11142)
(11232)
(11322)
(11412)
(12132)
(111132)
(111312)
(112212)
Lyndon and co-Lyndon compositions are counted by
A059966.
Numbers whose reversed binary expansion is Lyndon are
A328596.
Numbers whose binary expansion is co-Lyndon are
A275692.
Lyndon compositions that are not weakly increasing are
A329141.
Cf.
A000740,
A001037,
A008965,
A060223,
A102659,
A211100,
A329131,
A329312,
A329313,
A329318,
A329326.
-
lynQ[q_]:=Array[Union[{q,RotateRight[q,#1]}]=={q,RotateRight[q,#1]}&,Length[q]-1,1,And];
colynQ[q_]:=Array[Union[{RotateRight[q,#1],q}]=={RotateRight[q,#1],q}&,Length[q]-1,1,And];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],lynQ[#]&&!colynQ[Reverse[#]]&]],{n,15}]
A333765
Number of co-Lyndon factorizations of the k-th composition in standard order.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 2, 2, 4, 5, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 4, 2, 4, 4, 7, 7, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 5, 2, 5, 2, 4, 4, 9, 4, 7, 7, 12, 11, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 4, 1
Offset: 0
The a(54) = 5, a(61) = 7, and a(237) = 9 factorizations:
((1,2,1,2)) ((1,1,1,2,1)) ((1,1,2,1,2,1))
((1),(2,1,2)) ((1),(1,1,2,1)) ((1),(1,2,1,2,1))
((1,2),(2,1)) ((1,1),(1,2,1)) ((1,1),(2,1,2,1))
((2),(1,2,1)) ((2,1),(1,1,1)) ((1,2,1),(1,2,1))
((1),(2),(2,1)) ((1),(1),(1,2,1)) ((2,1),(1,1,2,1))
((1),(1,1),(2,1)) ((1),(1),(2,1,2,1))
((1),(1),(1),(2,1)) ((1,1),(2,1),(2,1))
((1),(2,1),(1,2,1))
((1),(1),(2,1),(2,1))
Binary necklaces are counted by
A000031.
Necklace compositions are counted by
A008965.
Necklaces covering an initial interval are counted by
A019536.
Lyndon compositions are counted by
A059966.
Numbers whose reversed binary expansion is a necklace are
A328595.
Numbers whose prime signature is a necklace are
A329138.
Length of Lyndon factorization of binary expansion is
A211100.
Length of co-Lyndon factorization of binary expansion is
A329312.
Length of co-Lyndon factorization of reversed binary expansion is
A329326.
Length of Lyndon factorization of reversed binary expansion is
A329313.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Co-Lyndon compositions are
A326774.
- Aperiodic compositions are
A328594.
- Reversed co-necklaces are
A328595.
- Length of Lyndon factorization is
A329312.
- Length of co-Lyndon factorization is
A334029.
- Combinatory separations are
A334030.
-
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
colynprod[]:={};colynprod[{},b_List]:=b;colynprod[a_List,{}]:=a;colynprod[a_List]:=a;
colynprod[{x_,a___},{y_,b___}]:=Switch[Ordering[If[x=!=y,{x,y},{colynprod[{a},{x,b}],colynprod[{x,a},{b}]}]],{1,2},Prepend[colynprod[{a},{y,b}],x],{2,1},Prepend[colynprod[{x,a},{b}],y]];
colynprod[a_List,b_List,c__List]:=colynprod[a,colynprod[b,c]];
sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
dealings[q_]:=Union[Function[ptn,Sort[q[[#]]&/@ptn]]/@sps[Range[Length[q]]]];
Table[Length[Select[dealings[stc[n]],colynprod@@#==stc[n]&]],{n,0,100}]
A334029
Length of the co-Lyndon factorization of the k-th composition in standard order.
Original entry on oeis.org
0, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 2, 2, 3, 4, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 5, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 1, 2
Offset: 0
The 441st composition in standard order is (1,2,1,1,3,1), with co-Lyndon factorization {(1),(3,1),(2,1,1)}, so a(441) = 3.
The version for binary expansion is (also)
A329312.
The version for reversed binary expansion is
A329326.
Binary Lyndon/co-Lyndon words are counted by
A001037.
Necklaces covering an initial interval are
A019536.
Lyndon/co-Lyndon compositions are counted by
A059966
Length of Lyndon factorization of binomial expansion is
A211100.
Numbers whose prime signature is a necklace are
A329138.
Length of Lyndon factorization of reversed binary expansion is
A329313.
A list of all binary co-Lyndon words is
A329318.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Co-Lyndon compositions are
A326774.
- Aperiodic compositions are
A328594.
- Reversed co-necklaces are
A328595.
- Co-Lyndon factorizations are counted by
A333765.
- Lyndon factorizations are counted by
A333940.
Cf.
A034691,
A060223,
A102659,
A211097,
A292884,
A296372,
A328596,
A329358,
A329359,
A329362,
A329400,
A329401,
A333939.
-
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#1],q}]=={RotateRight[q,#1],q}&,Length[q]-1,1,And];
colynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[colynfac[Drop[q,i]],Take[q,i]]][Last[Select[Range[Length[q]],colynQ[Take[q,#1]]&]]]]
Table[Length[colynfac[stc[n]]],{n,0,100}]
A302291
a(n) is the period of the binary expansion of n.
Original entry on oeis.org
1, 1, 2, 1, 3, 3, 3, 1, 4, 4, 2, 4, 4, 4, 4, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 2, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 0
The first terms, alongside the binary expansion of n with periodic part in parentheses, are:
n a(n) bin(n)
-- ---- ------
0 1 (0)
1 1 (1)
2 2 (10)
3 1 (1)(1)
4 3 (100)
5 3 (101)
6 3 (110)
7 1 (1)(1)(1)
8 4 (1000)
9 4 (1001)
10 2 (10)(10)
11 4 (1011)
12 4 (1100)
13 4 (1101)
14 4 (1110)
15 1 (1)(1)(1)(1)
16 5 (10000)
17 5 (10001)
18 5 (10010)
19 5 (10011)
20 5 (10100)
Aperiodic compositions are counted by
A000740.
Aperiodic binary words are counted by
A027375.
The orderless period of prime indices is
A052409.
Numbers whose binary expansion is periodic are
A121016.
Periodic compositions are counted by
A178472.
Numbers whose prime signature is aperiodic are
A329139.
Compositions by number of distinct rotations are
A333941.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Co-Lyndon compositions are
A326774.
- Aperiodic compositions are
A328594.
Cf.
A000031,
A001037,
A008965,
A019536,
A020330,
A211100,
A302295,
A328595,
A328596,
A329312,
A329313,
A329326.
-
Table[If[n==0,1,Length[Union[Array[RotateRight[IntegerDigits[n,2],#]&,IntegerLength[n,2]]]]],{n,0,50}] (* Gus Wiseman, Apr 19 2020 *)
-
a(n) = my (l=max(1, #binary(n))); fordiv (l, w, if (#Set(digits(n, 2^w))<=1, return (w)))
A334269
Number of compositions of n that are both a reversed Lyndon word and a co-Lyndon word.
Original entry on oeis.org
1, 1, 2, 3, 6, 8, 16, 23, 40, 62, 110, 169, 302, 492, 856, 1454, 2572, 4428, 7914, 13935, 25036, 44842, 81298, 147149, 268952, 491746, 904594, 1667091, 3085950, 5723367, 10652544, 19865887, 37150314, 69608939, 130723184, 245935633, 463590444, 875306913, 1655451592, 3135613649, 5948011978, 11298215516
Offset: 1
The a(1) = 1 through a(7) = 16 compositions:
(1) (2) (3) (4) (5) (6) (7)
(21) (31) (32) (42) (43)
(211) (41) (51) (52)
(221) (321) (61)
(311) (411) (322)
(2111) (2211) (331)
(3111) (421)
(21111) (511)
(2221)
(3121)
(3211)
(4111)
(21211)
(22111)
(31111)
(211111)
The version for binary expansion is
A334267.
Compositions of this type are ranked by
A334266.
Normal sequences of this type are counted by
A334270.
Necklace compositions of this type are counted by
A334271.
Aperiodic compositions are counted by
A000740.
Binary Lyndon words are counted by
A001037.
Necklace compositions are counted by
A008965.
Normal Lyndon words are counted by
A060223.
Lyndon compositions are counted by
A059966.
All of the following pertain to compositions in standard order (
A066099):
- Reversed Lyndon words are
A334265.
- Reversed co-Lyndon words are
A328596.
- Length of Lyndon factorization is
A329312.
- Length of co-Lyndon factorization is
A334029.
- Length of Lyndon factorization of reverse is
A334297.
- Length of co-Lyndon factorization of reverse is
A329313.
- Lyndon factorizations are counted by
A333940.
- Co-Lyndon factorizations are counted by
A333765.
- Aperiodic compositions are
A328594.
- Distinct rotations are counted by
A333632.
Cf.
A034691,
A065609,
A275692,
A328596,
A329141,
A329324,
A329326,
A334266,
A334272,
A334273,
A334274.
-
lynQ[q_]:=Length[q]==0||Array[Union[{q,RotateRight[q,#1]}]=={q,RotateRight[q,#1]}&,Length[q]-1,1,And];
colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],lynQ[Reverse[#]]&&colynQ[#]&]],{n,0,15}]
A329327
Numbers whose binary expansion has Lyndon factorization of length 2 (the minimum for n > 1).
Original entry on oeis.org
2, 3, 5, 9, 11, 17, 19, 23, 33, 35, 37, 39, 43, 47, 65, 67, 69, 71, 75, 77, 79, 87, 95, 129, 131, 133, 135, 137, 139, 141, 143, 147, 149, 151, 155, 157, 159, 171, 175, 183, 191, 257, 259, 261, 263, 265, 267, 269, 271, 275, 277, 279, 281, 283, 285, 287, 293
Offset: 1
The binary expansion of each term together with its Lyndon factorization begins:
2: (10) = (1)(0)
3: (11) = (1)(1)
5: (101) = (1)(01)
9: (1001) = (1)(001)
11: (1011) = (1)(011)
17: (10001) = (1)(0001)
19: (10011) = (1)(0011)
23: (10111) = (1)(0111)
33: (100001) = (1)(00001)
35: (100011) = (1)(00011)
37: (100101) = (1)(00101)
39: (100111) = (1)(00111)
43: (101011) = (1)(01011)
47: (101111) = (1)(01111)
65: (1000001) = (1)(000001)
67: (1000011) = (1)(000011)
69: (1000101) = (1)(000101)
71: (1000111) = (1)(000111)
75: (1001011) = (1)(001011)
77: (1001101) = (1)(001101)
Positions of rows of length 2 in
A329314.
The "co-" and reversed version is
A329357.
Length of the co-Lyndon factorization of the binary expansion is
A329312.
Cf.
A059966,
A060223,
A211097,
A275692,
A328594,
A328595,
A328596,
A329131,
A329313,
A329325,
A329326,
A339608.
-
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,#1]]&]]]];
Select[Range[100],Length[lynfac[IntegerDigits[#,2]]]==2&]
A333941
Triangle read by rows where T(n,k) is the number of compositions of n with rotational period k.
Original entry on oeis.org
1, 0, 1, 0, 2, 0, 0, 2, 2, 0, 0, 3, 2, 3, 0, 0, 2, 4, 6, 4, 0, 0, 4, 6, 9, 8, 5, 0, 0, 2, 6, 15, 20, 15, 6, 0, 0, 4, 8, 24, 32, 35, 18, 7, 0, 0, 3, 10, 27, 56, 70, 54, 28, 8, 0, 0, 4, 12, 42, 84, 125, 120, 84, 32, 9, 0, 0, 2, 10, 45, 120, 210, 252, 210, 120, 45, 10, 0
Offset: 0
Triangle begins:
1
0 1
0 2 0
0 2 2 0
0 3 2 3 0
0 2 4 6 4 0
0 4 6 9 8 5 0
0 2 6 15 20 15 6 0
0 4 8 24 32 35 18 7 0
0 3 10 27 56 70 54 28 8 0
0 4 12 42 84 125 120 84 32 9 0
0 2 10 45 120 210 252 210 120 45 10 0
0 6 18 66 168 335 450 462 320 162 50 11 0
Row n = 6 counts the following compositions (empty columns indicated by dots):
. (6) (15) (114) (1113) (11112) .
(33) (24) (123) (1122) (11121)
(222) (42) (132) (1131) (11211)
(111111) (51) (141) (1221) (12111)
(1212) (213) (1311) (21111)
(2121) (231) (2112)
(312) (2211)
(321) (3111)
(411)
A version counting runs is
A238279.
Aperiodic compositions are counted by
A000740.
Aperiodic binary words are counted by
A027375.
The orderless period of prime indices is
A052409.
Numbers whose binary expansion is periodic are
A121016.
Periodic compositions are counted by
A178472.
Period of binary expansion is
A302291.
Numbers whose prime signature is aperiodic are
A329139.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Co-Lyndon compositions are
A326774.
- Aperiodic compositions are
A328594.
Cf.
A000031,
A001037,
A008965,
A019536,
A211100,
A291166,
A328595,
A328596,
A329312,
A329313,
A329326.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Function[c,Length[Union[Array[RotateRight[c,#]&,Length[c]]]]==k]]],{n,0,10},{k,0,n}]
-
T(n,k)=if(n==0, k==0, sumdiv(n, m, sumdiv(gcd(k,m), d, moebius(d)*binomial(m/d-1, k/d-1)))) \\ Andrew Howroyd, Jan 19 2023
A329396
Numbers k such that the co-Lyndon factorization of the binary expansion of k is uniform.
Original entry on oeis.org
1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 38, 40, 42, 48, 50, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 127, 128, 136, 140, 142, 144, 160, 164, 168, 170, 192
Offset: 1
The sequence of terms together with their co-Lyndon factorizations begins:
1: (1) = (1)
2: (10) = (10)
3: (11) = (1)(1)
4: (100) = (100)
6: (110) = (110)
7: (111) = (1)(1)(1)
8: (1000) = (1000)
10: (1010) = (10)(10)
12: (1100) = (1100)
14: (1110) = (1110)
15: (1111) = (1)(1)(1)(1)
16: (10000) = (10000)
20: (10100) = (10100)
24: (11000) = (11000)
26: (11010) = (11010)
28: (11100) = (11100)
30: (11110) = (11110)
31: (11111) = (1)(1)(1)(1)(1)
32: (100000) = (100000)
36: (100100) = (100)(100)
38: (100110) = (100)(110)
40: (101000) = (101000)
42: (101010) = (10)(10)(10)
Numbers whose binary expansion has uniform Lyndon factorization are
A023758.
Numbers whose reversed binary expansion is Lyndon are
A328596.
Numbers whose binary expansion is co-Lyndon are
A275692.
Numbers whose trimmed binary expansion has Lyndon and co-Lyndon factorizations of equal lengths are
A329395.
Cf.
A001037,
A059966,
A060223,
A102659,
A211100,
A329131,
A329312,
A329313,
A329318,
A329326,
A329398.
-
colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
colynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[colynfac[Drop[q,i]],Take[q,i]]]@Last[Select[Range[Length[q]],colynQ[Take[q,#]]&]]];
Select[Range[100],SameQ@@Length/@colynfac[IntegerDigits[#,2]]&]
A329399
Numbers whose reversed binary expansion has uniform Lyndon factorization.
Original entry on oeis.org
1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 38, 40, 42, 44, 48, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 88, 92, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 127, 128, 136, 140, 142, 144, 152, 160, 164, 168, 170
Offset: 1
The sequence of terms together with their reversed binary expansions and Lyndon factorizations begins:
1: (1) = (1)
2: (01) = (01)
3: (11) = (1)(1)
4: (001) = (001)
6: (011) = (011)
7: (111) = (1)(1)(1)
8: (0001) = (0001)
10: (0101) = (01)(01)
12: (0011) = (0011)
14: (0111) = (0111)
15: (1111) = (1)(1)(1)(1)
16: (00001) = (00001)
20: (00101) = (00101)
24: (00011) = (00011)
26: (01011) = (01011)
28: (00111) = (00111)
30: (01111) = (01111)
31: (11111) = (1)(1)(1)(1)(1)
32: (000001) = (000001)
36: (001001) = (001)(001)
38: (011001) = (011)(001)
40: (000101) = (000101)
42: (010101) = (01)(01)(01)
44: (001101) = (001101)
48: (000011) = (000011)
Numbers whose binary expansion has uniform Lyndon factorization and uniform co-Lyndon factorization are
A023758.
Numbers whose reversed binary expansion is Lyndon are
A328596.
Numbers whose binary expansion is co-Lyndon are
A275692.
Numbers whose trimmed binary expansion has Lyndon and co-Lyndon factorizations of equal lengths are
A329395.
Cf.
A001037,
A059966,
A060223,
A102659,
A211100,
A329131,
A329312,
A329313,
A329318,
A329326,
A329396.
-
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,#]]&]]]];
Select[Range[100],SameQ@@Length/@lynfac[Reverse[IntegerDigits[#,2]]]&]
Comments