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.
%I A350346 #48 Aug 05 2024 05:25:10 %S A350346 0,1,11,101,111,1011,1101,1111,10011,10101,10111,11011,11101,11111, %T A350346 100111,101011,101101,101111,110011,110101,110111,111011,111101, %U A350346 111111,1000111,1001011,1001101,1001111,1010011,1010101,1010111,1011011,1011101,1011111,1100111 %N A350346 Binary numbers such that when read from right to left, the number of 0's never exceeds the number of 1's. %C A350346 Binary expansion of A036991 terms. %C A350346 Dyck language interpreted as binary numbers in ascending order (inverse encode of A063171). %C A350346 The first term a(1)=0 corresponds to an empty string, denote it NULL. %C A350346 Restoring the leading 0's (need the same number of 0's and 1's) and then replacing "0" by the left parenthesis "(" and "1" by the right parenthesis ")" give well-formed parenthesis strings: 0 -> NULL, 1=01 -> (), 11=0011 -> (()), 101=0101 -> ()(), 111=000111 -> ((())), 1011=001011 -> (()()), 1101=001101 -> (())() and so on. %C A350346 Chomsky-2 grammar with axiom s, terminal alphabet {0, 1} and three rules s -> ss, s -> 0s1, s -> 01 (compare A063171). %H A350346 Gennady Eremin, <a href="/A350346/b350346.txt">Table of n, a(n) for n = 1..5000</a> %H A350346 Gennady Eremin, <a href="https://arxiv.org/abs/2302.02765">Dyck Numbers, III. Enumeration and bijection with symmetric Dyck paths</a>, arXiv:2302.02765 [math.CO], 2023. %H A350346 Gennady Eremin, <a href="https://arxiv.org/abs/2306.10318">Dyck Numbers, IV. Nested patterns in OEIS A036991</a>, arXiv:2306.10318, 2023. %F A350346 a(n) = A007088(A036991(n)). - _Michel Marcus_, Dec 26 2021 %e A350346 s -> ss -> 0s1s -> 00s11s -> 000111s -> 00011101 = 11101. %t A350346 Join[{0},Select[Table[FromDigits[IntegerDigits[n,2]],{n,120}],Min[Accumulate[ Reverse[ IntegerDigits[#]]/.(0->-1)]]>=0&]] (* _Harvey P. Dale_, Apr 29 2022 *) %o A350346 (Python) %o A350346 def ok(n): %o A350346 if n == 0: return True %o A350346 count = {"0": 0, "1": 0} %o A350346 for bit in bin(n)[:1:-1]: %o A350346 count[bit] += 1 %o A350346 if count["0"] > count["1"]: return False %o A350346 return True # A036991 %o A350346 nn = 1; print(1, 0) %o A350346 for n in range(1, 23230): # printing b-file %o A350346 if ok(n) == False: continue %o A350346 nn += 1; print(nn, bin(n)[2:]) %o A350346 (Python) %o A350346 from itertools import count, islice %o A350346 def A350346_gen(): # generator of terms %o A350346 yield 0 %o A350346 for n in count(1): %o A350346 s = bin(n)[2:] %o A350346 c, l = 0, len(s) %o A350346 for i in range(l): %o A350346 c += int(s[l-i-1]) %o A350346 if 2*c <= i: %o A350346 break %o A350346 else: %o A350346 yield int(s) %o A350346 A350346_list = list(islice(A350346_gen(),20)) # _Chai Wah Wu_, Dec 30 2021 %Y A350346 Cf. A007088, A036991, A014486, A063171. %K A350346 nonn,base %O A350346 1,3 %A A350346 _Gennady Eremin_, Dec 26 2021