%I #26 Feb 12 2025 18:45:03
%S 0,100,110,101000,101010,101100,101110,1110000,1110010,1110100,
%T 1110110,1111000,1111010,1111100,1111110,10100100000,10100100010,
%U 10100100100,10100100110,10100101000,10100101010,10100101100,10100101110,10100110000,10100110010,10100110100
%N Elias's omega code for n.
%C The idea of the Elias omega code is similar to that of the Elias delta code (A281150), except that the length of the codeword in the omega code is recursively encoded.
%C The number of bits in a(n) is equal to A072464(n).
%H Indranil Ghosh, <a href="/A281193/b281193.txt">Table of n, a(n) for n = 1..10000</a>
%H Khalid Sayood (Editor), <a href="https://books.google.co.in/books?id=LjQiGwyabVwC&pg=PA60&lpg=PA60&dq=bl&ots=DEU6sh5UC9&sig=GJcMAaVWdAH1pQ4LYNyZVaMUlRM&hl=en&sa=X&ved=0ahUKEwjzq7ulvcfRAhVJRo8KHbNUC1QQ6AEIITAB#v=onepage&q=Even%20Rodeh&f=false">Lossless Compression Handbook</a>, Chapter 3 - Universal Codes, p. 59, section 3.6.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Elias_omega_coding">Elias omega coding</a>
%o (Python)
%o def E(n):
%o s=""
%o if n==1:
%o return "0"
%o else:
%o b=(bin(n)[2:])
%o s+=E(len(b)-1)+b
%o return s
%o def elias_omega(n):
%o return int(E(n)[1:]+"0")
%Y Cf. A072464, A281149, A281150.
%K nonn,base,changed
%O 1,2
%A _Indranil Ghosh_, Jan 17 2017