A328595
Numbers whose reversed binary expansion is a necklace.
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, 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, 144, 152, 160, 164, 168, 170, 172, 176, 180
Offset: 1
The sequence of terms together with their binary expansions and binary indices begins:
1: 1 ~ {1}
2: 10 ~ {2}
3: 11 ~ {1,2}
4: 100 ~ {3}
6: 110 ~ {2,3}
7: 111 ~ {1,2,3}
8: 1000 ~ {4}
10: 1010 ~ {2,4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
15: 1111 ~ {1,2,3,4}
16: 10000 ~ {5}
20: 10100 ~ {3,5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
31: 11111 ~ {1,2,3,4,5}
32: 100000 ~ {6}
36: 100100 ~ {3,6}
The version with the most significant digit ignored is
A328607.
-
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Select[Range[100],neckQ[Reverse[IntegerDigits[#,2]]]&]
-
from itertools import count, islice
from sympy.utilities.iterables import necklaces
def a_gen():
for n in count(1):
t = []
for i in necklaces(n,2):
if sum(i)>0:
t.append(sum(2**j for j in range(len(i)) if i[j] > 0))
yield from sorted(t)
A328595_list = list(islice(a_gen(), 100)) # John Tyler Rascoe, May 24 2024
A065609
Positive m such that when written in binary, no rotated value of m is greater than m.
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, 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, 144, 160, 164, 168, 170, 192, 194, 196, 200, 202
Offset: 1
Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Nov 06 2001
14 is included because 14 in binary is 1110. 1110 has the rotated values of 0111, 1011 and 1101 -- 7, 11 and 13 -- which are all smaller than 14.
The version with the most significant digit ignored is
A328668 or
A328607.
Numbers whose reversed binary expansion is a Lyndon word are
A328596.
Numbers whose binary expansion is aperiodic are
A328594.
-
filter:= proc(n) local L, k;
if n::odd then return evalb(n+1 = 2^ilog2(n+1)) fi;
L:= convert(convert(n,binary),string);
for k from 1 to length(L)-1 do
if not lexorder(StringTools:-Rotate(L,k),L) then return false fi;
od;
true
end proc:
select(filter, [$1..1000]); # Robert Israel, Aug 05 2016
-
Select[Range[200], # == Max[FromDigits[#, 2] & /@ NestList[RotateLeft, dg = IntegerDigits[#, 2], Length@dg]] &] (* Ivan Neretin, Aug 04 2016 *)
-
def ok(n):
b = bin(n)[2:]
return b > "0" and all(b[i:] + b[:i] <= b for i in range(1, len(b)))
print([k for k in range(203) if ok(k)]) # Michael S. Branicky, May 26 2022
A257250
Numbers n for which A256999(n) = n; numbers that cannot be made any larger by rotating (by one or more steps) the non-msb bits of their binary representation (with A080541 or A080542).
Original entry on oeis.org
0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 26, 28, 30, 31, 32, 48, 52, 56, 58, 60, 62, 63, 64, 96, 100, 104, 106, 112, 114, 116, 118, 120, 122, 124, 126, 127, 128, 192, 200, 208, 212, 224, 226, 228, 232, 234, 236, 240, 242, 244, 246, 248, 250, 252, 254, 255, 256, 384, 392, 400, 416, 420, 424, 426, 448, 450
Offset: 0
For n = 5, with binary representation "101", if we rotate other bits than the most significant bit (that is, only the two rightmost digits "01") one step to either direction, we get "110" = 6 > 5, so 5 can be made larger by such rotations, and thus is NOT included in this sequence.
For n = 6, with binary representation "110", no such rotation will yield a larger number, and thus 6 is included in this sequence.
For n = 28, with binary representation "11100", if we rotate non-msb bits towards right, we get additional numbers 22, 19 and 25 (with binary representations "10110", "10011", "11001") before coming to 28 again, and 28 is the largest of these numbers, thus 28 is included in this sequence.
Also, if we discard the most significant bit of each and consider them just as binary strings, then A053645(28) = 12 is the lexicographically largest representative of {"1100", "0110", "0011", "1001"}, which is the complete set of representatives for a particular equivalence class of binary necklaces, obtained by rotating all bits of binary string "1100" successively towards right or left.
The version involving all digits is
A065609.
The non-dual reversed version is
A328607.
Numbers whose reversed binary expansion is a necklace are
A328595.
-
reckQ[q_]:=Array[OrderedQ[{RotateRight[q,#],q}]&,Length[q]-1,1,And];
Select[Range[0,110],#<=1||reckQ[Rest[IntegerDigits[#,2]]]&] (* Gus Wiseman, Nov 04 2019 *)
A328607
Numbers whose reversed binary expansion, without the most significant digit, is a necklace.
Original entry on oeis.org
0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 26, 28, 30, 31, 32, 48, 52, 56, 58, 60, 62, 63, 64, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 127, 128, 192, 200, 208, 212, 216, 220, 224, 228, 232, 234, 236, 240, 244, 246, 248, 250, 252, 254, 255
Offset: 0
The sequence of terms together with their binary expansions and binary indices begins:
0: 0 ~ {}
1: 1 ~ {1}
2: 10 ~ {2}
3: 11 ~ {1,2}
4: 100 ~ {3}
6: 110 ~ {2,3}
7: 111 ~ {1,2,3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
15: 1111 ~ {1,2,3,4}
16: 10000 ~ {5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
31: 11111 ~ {1,2,3,4,5}
32: 100000 ~ {6}
48: 110000 ~ {5,6}
52: 110100 ~ {3,5,6}
The dual non-reversed version is
A257250.
The dual non-reversed version involving all digits is
A065609.
The version involving all digits is
A328595.
The non-reversed version is
A328668.
-
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Select[Range[0,100],#<=1||neckQ[Reverse[Rest[IntegerDigits[#,2]]]]&]
A257739
Numbers n for which A256999(n) > n; numbers that can be made larger by rotating (by one or more steps) the non-msb bits of their binary representation (with A080541 or A080542).
Original entry on oeis.org
5, 9, 10, 11, 13, 17, 18, 19, 20, 21, 22, 23, 25, 27, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 59, 61, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 101, 102, 103, 105, 107, 108, 109, 110, 111
Offset: 1
For n = 5 with binary representation "101" if we rotate other bits than the most significant bit (that is, only the two rightmost digits "01") one step to either direction we get "110" = 6 > 5, so 5 can be made larger by such rotations and thus 5 is included in this sequence.
For n = 6 with binary representation "110" no such rotation will yield a larger number and thus 6 is NOT included in this sequence.
For n = 10 with binary representation "1010" if we rotate other bits than the most significant bit (that is, only the three rightmost digits "010") either one step to the left or two steps to the right we get "1100" = 12 > 10, thus 10 is included in this sequence.
Numbers whose binary expansion is a necklace are
A275692.
Numbers whose binary expansion is a co-necklace are
A065609.
Numbers whose reversed binary expansion is a necklace are
A328595.
Numbers whose non-msb expansion is a co-necklace are
A257250.
Numbers whose non-msb expansion is a necklace are
A328668.
Numbers whose reversed non-msb expansion is a necklace are
A328607.
Numbers whose non-msb expansion is not a necklace are
A329367.
-
reckQ[q_]:=Array[OrderedQ[{RotateRight[q,#],q}]&,Length[q]-1,1,And];
Select[Range[2,100],!reckQ[Rest[IntegerDigits[#,2]]]&] (* Gus Wiseman, Nov 14 2019 *)
A329367
Numbers whose binary expansion, without the most significant digit, is not a necklace.
Original entry on oeis.org
6, 10, 12, 13, 14, 18, 20, 22, 24, 25, 26, 27, 28, 29, 30, 34, 36, 38, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 70, 72, 74, 76, 78, 80, 81, 82, 83, 84, 86, 88, 89, 90, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102
Offset: 1
The sequence of terms together with their binary expansions begins:
6: (1,1,0)
10: (1,0,1,0)
12: (1,1,0,0)
13: (1,1,0,1)
14: (1,1,1,0)
18: (1,0,0,1,0)
20: (1,0,1,0,0)
22: (1,0,1,1,0)
24: (1,1,0,0,0)
25: (1,1,0,0,1)
26: (1,1,0,1,0)
27: (1,1,0,1,1)
28: (1,1,1,0,0)
29: (1,1,1,0,1)
30: (1,1,1,1,0)
34: (1,0,0,0,1,0)
36: (1,0,0,1,0,0)
38: (1,0,0,1,1,0)
40: (1,0,1,0,0,0)
41: (1,0,1,0,0,1)
The version involving all digits is
A062289.
Numbers whose binary expansion is a necklace are
A275692.
Numbers whose reversed binary expansion is a necklace are
A328595.
-
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Select[Range[2,100],!neckQ[Rest[IntegerDigits[#,2]]]&]
Showing 1-6 of 6 results.
Comments