Whatever you do, you'll find that *on average* you will need *at least* 34 bits to be able to represent all possible 10-digit decimal numbers. Some might be shorter, but then others will be longer, and the average won't be less than 34.
The theoretical limit for arbitrary numbers 0 - 9 must be viewed as an average not as an impossibility to, in some cases be able to compress to or under 34. This is obvious by the decimal to binary function. -- https://mail.python.org/mailman/listinfo/python-list