cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A383667 Binary words beginning with 1 in which no binary digit occurs only once.

This page as a plain text file.
%I A383667 #14 May 21 2025 12:39:44
%S A383667 11,111,1001,1010,1100,1111,10001,10010,10011,10100,10101,10110,11000,
%T A383667 11001,11010,11100,11111,100001,100010,100011,100100,100101,100110,
%U A383667 100111,101000,101001,101010,101011,101100,101101,101110,110000,110001,110010,110011
%N A383667 Binary words beginning with 1 in which no binary digit occurs only once.
%t A383667 s = Select[Range[200], DigitCount[#, 2, 0] != 1 && DigitCount[#, 2, 1] != 1 &]
%t A383667 Map[First, RealDigits[s, 2]]; Map[FromDigits, m]
%o A383667 (Python)
%o A383667 def A383667(n):
%o A383667     def f(x):
%o A383667         if x<=1: return n+x
%o A383667         l, s = x.bit_length(), bin(x)[2:]
%o A383667         if (m:=s.count('0'))>0: return n+s.index('0')-(m>1)+(l*(l-1)>>1)
%o A383667         return n-1+(l*(l+1)>>1)
%o A383667     m, k = n, f(n)
%o A383667     while m != k: m, k = k, f(k)
%o A383667     return int(bin(m)[2:]) # _Chai Wah Wu_, May 21 2025
%Y A383667 Cf. A158581, A383666.
%K A383667 nonn,base
%O A383667 1,1
%A A383667 _Clark Kimberling_, May 07 2025