Sturmian word
Sturmian word
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
A Sturmian word is a binary sequence, finite or infinite, that makes up the cutting sequence for a positive real number x, as shown in the picture.
The Sturmian word can be computed thus as an algorithm:
- If x > 1, then it is the inverse of the Sturmian word for (1/x). So we have reduced to the case of 0 < x < 1.
- Iterate over
- If is an integer, then the program terminates. Else, if , then the program outputs 0, else, it outputs 10.