How to count in binary using any ordered sequence of symbols