The concept of a [Sturmian word][1] admits several equivalent definitions which one can work with, and which are not obviously equivalent. [1]: https://en.wikipedia.org/wiki/Sturmian_word