A385575 Numbers whose binary indices have the same number of adjacent parts differing by 1 as adjacent parts differing by more than 1.
1, 2, 4, 8, 11, 13, 16, 19, 22, 25, 26, 32, 35, 38, 44, 49, 50, 52, 64, 67, 70, 76, 87, 88, 91, 93, 97, 98, 100, 104, 107, 109, 117, 128, 131, 134, 140, 151, 152, 155, 157, 167, 174, 176, 179, 182, 185, 186, 193, 194, 196, 200, 203, 205, 208, 211, 214, 217
Offset: 1
Keywords
Examples
The terms together with their binary expansions and binary indices begin: 1: 1 ~ {1} 2: 10 ~ {2} 4: 100 ~ {3} 8: 1000 ~ {4} 11: 1011 ~ {1,2,4} 13: 1101 ~ {1,3,4} 16: 10000 ~ {5} 19: 10011 ~ {1,2,5} 22: 10110 ~ {2,3,5} 25: 11001 ~ {1,4,5} 26: 11010 ~ {2,4,5} 32: 100000 ~ {6} 35: 100011 ~ {1,2,6} 38: 100110 ~ {2,3,6} 44: 101100 ~ {3,4,6} 49: 110001 ~ {1,5,6} 50: 110010 ~ {2,5,6} 52: 110100 ~ {3,5,6} 64: 1000000 ~ {7} 67: 1000011 ~ {1,2,7} 70: 1000110 ~ {2,3,7} 76: 1001100 ~ {3,4,7} 87: 1010111 ~ {1,2,3,5,7} 88: 1011000 ~ {4,5,7} 91: 1011011 ~ {1,2,4,5,7} 93: 1011101 ~ {1,3,4,5,7} 97: 1100001 ~ {1,6,7} 98: 1100010 ~ {2,6,7} 100: 1100100 ~ {3,6,7}
Crossrefs
Programs
-
Mathematica
bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; Select[Range[100],Length[Split[bpe[#],#2==#1+1&]]==Length[Split[bpe[#],#2!=#1+1&]]&]
-
PARI
is_ok(n)=hammingweight(n)==2*hammingweight(bitand(n,n>>1))+1 \\ Christian Sievers, Jul 18 2025
Comments