%I #28 Feb 18 2022 21:03:03
%S 0,1,10,11,101,110,111,1011,1101,1110,1111,10110,10111,11011,11101,
%T 11110,11111,101101,101110,101111,110110,110111,111011,111101,111110,
%U 111111,1011011,1011101,1011110,1011111,1101101,1101110,1101111,1110110,1110111,1111011
%N Narayana weighted representation of n (the bottom version). Also binary representation of numbers not containing 00 or 010 as a substring.
%C a(n) equals binary representation of m, if and only if A350311(m) = n and for all k < m, A350311(k) < n.
%H A.H.M. Smeets, <a href="/A350215/a350215.pdf">The design of greedy number representations</a>
%F Regular expression: 0|11*(0111*)*(0|01|011*)?.
%t q[n_] := SequenceCount[IntegerDigits[n, 2], #] & /@ {{0, 0}, {0, 1, 0}} == {0, 0}; bin[n_] := FromDigits[IntegerDigits[n, 2]]; bin /@ Select[Range[0, 120], q] (* _Amiram Eldar_, Jan 27 2022 *)
%o (Python) # first method (as from definition)
%o def A101(n):
%o f0, f1, f2, r = 1, 1, 1, 0
%o while n > 0:
%o if n%2 == 1:
%o r = r+f0
%o n, f0, f1, f2 = n//2, f0+f2, f0, f1
%o return r
%o n, a = 0, 0
%o while n < 36:
%o if A101(a) == n:
%o print(bin(a)[2:], end = ", ")
%o n += 1
%o a += 1
%o (Python) # second method (as from regular expression)
%o def test(n):
%o s, i, n1 = bin(n)[2:], 0, 2
%o while i < len(s):
%o if s[i] == "0":
%o if n1 < 2:
%o return 0
%o n1 = 0
%o else:
%o n1 += 1
%o i += 1
%o return 1
%o n, a = 0, 0
%o while n < 36:
%o if test(a):
%o print(bin(a)[2:], end = ", ")
%o n += 1
%o a += 1
%Y Cf. A000930, A048715, A350215 (top version), A350311.
%Y Fibonacci representations: A014417 (Zeckendorf), A104326 (dual Zeckendorf).
%K nonn,base
%O 0,3
%A _A.H.M. Smeets_, Dec 24 2021