encode and decode numbers as text using markov chains