# Least-buffer 2ᵏ→n∈⟨1;2ᵏ⟩∩ℕ base conversion of equal-probability messages source

Having an infinite source of messages of $$2^k$$ possible values of equal probability of occurrence, what is the least necessary buffer needed for a reversible conversion of it to a source of messages of $$n\in\mathbb{N}\cap[1,2^k]$$ possible values of equal probability of occurence?

• i need a base-n code that wouldn't require me to predict the whole (infinite) sequence of values but just a worst-case-finite buffer of computable length for bases other than powers of 2 – Michał Krzysztof Feiler Nov 7 at 22:34
• i want to write, like, an encoder… like, if i understand correctly for base36 there is no algorithm that doesn't require access to the whole number. and i want such system of base-n that would allow me to do that with a finite buffer, like, having an infinite number and converting its, like, mantissa. or a proof that there can't be such – Michał Krzysztof Feiler Nov 7 at 22:35
• it can be thought of as a transcoder in which i can truncate some of the information as long as worst-case amount of information dropped will be constant for the given bases – Michał Krzysztof Feiler Nov 7 at 22:43