login
A334274
Numbers k such that the k-th composition in standard order is both a necklace and a reversed co-necklace.
5
0, 1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 40, 42, 48, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 127, 128, 136, 144, 160, 164, 168, 170, 192, 200, 204, 208, 212, 216
OFFSET
1,3
COMMENTS
Also numbers whose binary expansion is both a reversed necklace and a co-necklace.
A necklace is a finite sequence of positive integers that is lexicographically less than or equal to any cyclic rotation. Co-necklaces are defined similarly, except with greater instead of less.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
EXAMPLE
The sequence of all reversed co-necklace necklaces begins:
0: () 31: (1,1,1,1,1) 100: (1,3,3)
1: (1) 32: (6) 104: (1,2,4)
2: (2) 36: (3,3) 106: (1,2,2,2)
3: (1,1) 40: (2,4) 108: (1,2,1,3)
4: (3) 42: (2,2,2) 112: (1,1,5)
6: (1,2) 48: (1,5) 116: (1,1,2,3)
7: (1,1,1) 52: (1,2,3) 118: (1,1,2,1,2)
8: (4) 54: (1,2,1,2) 120: (1,1,1,4)
10: (2,2) 56: (1,1,4) 122: (1,1,1,2,2)
12: (1,3) 58: (1,1,2,2) 124: (1,1,1,1,3)
14: (1,1,2) 60: (1,1,1,3) 126: (1,1,1,1,1,2)
15: (1,1,1,1) 62: (1,1,1,1,2) 127: (1,1,1,1,1,1,1)
16: (5) 63: (1,1,1,1,1,1) 128: (8)
20: (2,3) 64: (7) 136: (4,4)
24: (1,4) 72: (3,4) 144: (3,5)
26: (1,2,2) 80: (2,5) 160: (2,6)
28: (1,1,3) 84: (2,2,3) 164: (2,3,3)
30: (1,1,1,2) 96: (1,6) 168: (2,2,4)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
neckQ[q_]:=Length[q]==0||Array[OrderedQ[{q, RotateRight[q, #]}]&, Length[q]-1, 1, And];
coneckQ[q_]:=Length[q]==0||Array[OrderedQ[{RotateRight[q, #], q}]&, Length[q]-1, 1, And];
Select[Range[0, 100], neckQ[stc[#]]&&coneckQ[Reverse[stc[#]]]&]
CROSSREFS
The aperiodic case is A334267.
Compositions of this type are counted by A334271.
Normal sequences of this type are counted by A334272.
Binary (or reversed binary) necklaces are counted by A000031.
Necklace compositions are counted by A008965.
All of the following pertain to compositions in standard order (A066099):
- Necklaces are A065609.
- Reversed necklaces are A333943.
- Co-necklaces are A333764.
- Reversed co-necklaces are A328595.
- Lyndon words are A275692.
- Co-Lyndon words are A326774.
- Reversed Lyndon words are A334265.
- Reversed co-Lyndon words are A328596.
- Aperiodic compositions are A328594.
Sequence in context: A329396 A328595 A065609 * A225620 A335041 A335042
KEYWORD
nonn
AUTHOR
Gus Wiseman, Apr 25 2020
STATUS
approved