%I #27 Nov 26 2022 16:14:47
%S 0,1,2,4,6,8,12,14,16,20,24,26,28,30,32,40,48,50,52,56,58,60,62,64,72,
%T 80,84,96,98,100,104,106,108,112,114,116,118,120,122,124,126,128,144,
%U 160,164,168,192,194,196,200,202,208,210,212,216,218,224,226,228
%N Numbers k such that every rotation of the binary digits of k is less than k.
%C 0, and terms of A065609 that are not in A121016.
%C Number of terms with d binary digits is A001037(d).
%C Take the binary representation of a(n), reverse it, add 1 to each digit. The result is the decimal representation of A102659(n).
%C From _Gus Wiseman_, Apr 19 2020: (Start)
%C Also numbers k such that the k-th composition in standard order (row k of A066099) is a Lyndon word. For example, the sequence of all Lyndon words begins:
%C 0: () 52: (1,2,3) 118: (1,1,2,1,2)
%C 1: (1) 56: (1,1,4) 120: (1,1,1,4)
%C 2: (2) 58: (1,1,2,2) 122: (1,1,1,2,2)
%C 4: (3) 60: (1,1,1,3) 124: (1,1,1,1,3)
%C 6: (1,2) 62: (1,1,1,1,2) 126: (1,1,1,1,1,2)
%C 8: (4) 64: (7) 128: (8)
%C 12: (1,3) 72: (3,4) 144: (3,5)
%C 14: (1,1,2) 80: (2,5) 160: (2,6)
%C 16: (5) 84: (2,2,3) 164: (2,3,3)
%C 20: (2,3) 96: (1,6) 168: (2,2,4)
%C 24: (1,4) 98: (1,4,2) 192: (1,7)
%C 26: (1,2,2) 100: (1,3,3) 194: (1,5,2)
%C 28: (1,1,3) 104: (1,2,4) 196: (1,4,3)
%C 30: (1,1,1,2) 106: (1,2,2,2) 200: (1,3,4)
%C 32: (6) 108: (1,2,1,3) 202: (1,3,2,2)
%C 40: (2,4) 112: (1,1,5) 208: (1,2,5)
%C 48: (1,5) 114: (1,1,3,2) 210: (1,2,3,2)
%C 50: (1,3,2) 116: (1,1,2,3) 212: (1,2,2,3)
%C (End)
%H Robert Israel, <a href="/A275692/b275692.txt">Table of n, a(n) for n = 1..9868</a>
%e 6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
%e 10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
%e From _Gus Wiseman_, Oct 31 2019: (Start)
%e The sequence of terms together with their binary expansions and binary indices begins:
%e 1: 1 ~ {1}
%e 2: 10 ~ {2}
%e 4: 100 ~ {3}
%e 6: 110 ~ {2,3}
%e 8: 1000 ~ {4}
%e 12: 1100 ~ {3,4}
%e 14: 1110 ~ {2,3,4}
%e 16: 10000 ~ {5}
%e 20: 10100 ~ {3,5}
%e 24: 11000 ~ {4,5}
%e 26: 11010 ~ {2,4,5}
%e 28: 11100 ~ {3,4,5}
%e 30: 11110 ~ {2,3,4,5}
%e 32: 100000 ~ {6}
%e 40: 101000 ~ {4,6}
%e 48: 110000 ~ {5,6}
%e 50: 110010 ~ {2,5,6}
%e 52: 110100 ~ {3,5,6}
%e 56: 111000 ~ {4,5,6}
%e 58: 111010 ~ {2,4,5,6}
%e (End)
%p filter:= proc(n) local L, k;
%p L:= convert(convert(n,binary),string);
%p for k from 1 to length(L)-1 do
%p if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
%p od;
%p true
%p end proc:
%p select(filter, [$0..1000]);
%t filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
%t Select[Range[0, 1000], filterQ] (* _Jean-François Alcover_, Apr 29 2019 *)
%o (Python)
%o def ok(n):
%o b = bin(n)[2:]
%o return all(b[i:] + b[:i] < b for i in range(1, len(b)))
%o print([k for k in range(230) if ok(k)]) # _Michael S. Branicky_, May 26 2022
%Y A similar concept is A328596.
%Y Numbers whose binary expansion is aperiodic are A328594.
%Y Numbers whose reversed binary expansion is a necklace are A328595.
%Y Binary necklaces are A000031.
%Y Binary Lyndon words are A001037.
%Y Lyndon compositions are A059966.
%Y Length of Lyndon factorization of binary expansion is A211100.
%Y Length of co-Lyndon factorization of binary expansion is A329312.
%Y Length of Lyndon factorization of reversed binary expansion is A329313.
%Y Length of co-Lyndon factorization of reversed binary expansion is A329326.
%Y Cf. A000031, A000740, A008965, A027375, A102659, A121016.
%Y All of the following pertain to compositions in standard order (A066099):
%Y - Length is A000120.
%Y - Necklaces are A065609.
%Y - Sum is A070939.
%Y - Rotational symmetries are counted by A138904.
%Y - Strict compositions are A233564.
%Y - Constant compositions are A272919.
%Y - Lyndon compositions are A275692 (this sequence).
%Y - Co-Lyndon compositions are A326774.
%Y - Rotational period is A333632.
%Y - Co-necklaces are A333764.
%Y - Co-Lyndon factorizations are counted by A333765.
%Y - Lyndon factorizations are counted by A333940.
%Y - Reversed necklaces are A333943.
%Y Cf. A034691, A060223, A124767, A269134, A292884.
%K nonn
%O 1,3
%A _Robert Israel_, Aug 05 2016
|