A383667 Binary words beginning with 1 in which no binary digit occurs only once.
11, 111, 1001, 1010, 1100, 1111, 10001, 10010, 10011, 10100, 10101, 10110, 11000, 11001, 11010, 11100, 11111, 100001, 100010, 100011, 100100, 100101, 100110, 100111, 101000, 101001, 101010, 101011, 101100, 101101, 101110, 110000, 110001, 110010, 110011
Offset: 1
Programs
-
Mathematica
s = Select[Range[200], DigitCount[#, 2, 0] != 1 && DigitCount[#, 2, 1] != 1 &] Map[First, RealDigits[s, 2]]; Map[FromDigits, m]
-
Python
def A383667(n): def f(x): if x<=1: return n+x l, s = x.bit_length(), bin(x)[2:] if (m:=s.count('0'))>0: return n+s.index('0')-(m>1)+(l*(l-1)>>1) return n-1+(l*(l+1)>>1) m, k = n, f(n) while m != k: m, k = k, f(k) return int(bin(m)[2:]) # Chai Wah Wu, May 21 2025
Comments