login
A140341
The number of bits needed to write the universal code for an Elias delta coding, the simplest asymptotically optimal code.
2
1, 4, 4, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
OFFSET
1,2
COMMENTS
A129972 is the number of bits for Elias gamma coding 1, 3, 3, 5 and A130233 is the number of bits for Fibonacci coding of integers 2, 3, 4, 4, 5, But Elias gamma and Fibonacci coding are not asymptotically optimal.
REFERENCES
David Salomon, Variable-length Codes for Data Compression, Springer Verlag, 2007, 191 pp.
LINKS
Debra A. Lelewer and Daniel S. Hirschberg, Data Compression. See Section 3, Elias Delta.
Hugh E. Williams and Justin Zobel, Compressing integers for fast file access, The Computer Journal 42 (1999), pp. 193-201.
EXAMPLE
The Elias Delta Code for 10 is '11000010', having 8 bits. So, a(10) = 8. - Indranil Ghosh, Jan 17 2017
PROG
(PARI) a(n)=my(b=log(n+.5)\log(2)); b+log(b+1.5)\log(2)*2+1 \\ Charles R Greathouse IV, Mar 21 2012
CROSSREFS
Cf. A281150 - Indranil Ghosh, Jan 17 2017
Sequence in context: A167770 A080800 A253443 * A332609 A244234 A237449
KEYWORD
nonn,easy
AUTHOR
David A. Scott (biject.bwts(AT)gmail.com), May 29 2008
STATUS
approved