Post History
A Sturmian sequence is an infinite binary sequence satisfying two properties: It is balanced. This can be stated a number of equivalent ways: There is no pair of equal length subwords whose d...
#2: Post edited
- A [Sturmian sequence](https://en.wikipedia.org/wiki/Sturmian_word) is an infinite binary sequence satisfying two properties:
- * It is *balanced*. This can be stated a number of equivalent ways:
* There is no pair of equal length subwords whose digit sums differ by more than 2.- * There is no string $w$ such that $0w0$ and $1w1$ are both substrings.
- * It is not *eventually periodic*. No (infinite) suffix of the sequence consists of a finite string repeated infinitely.
- Your challenge is to output a Sturmian sequence of your own choosing.
- You may output an infinite sequence in any of the following ways:
- - Output an infinite list or some sort of lazy sequence structure.
- - Print the terms of the sequence in order indefinitely.
- - Take an input $n$ and output the $n$th term of your sequence. ($1$ indexing is permitted)
- - Take an input $n$ and output the first $n$ terms of your sequence.
- This is code-golf, so the goal is to minimize the size of your source code as measured in bytes.
- A [Sturmian sequence](https://en.wikipedia.org/wiki/Sturmian_word) is an infinite binary sequence satisfying two properties:
- * It is *balanced*. This can be stated a number of equivalent ways:
- * There is no pair of equal length subwords whose digit sums differ by 2 or more.
- * There is no string $w$ such that $0w0$ and $1w1$ are both substrings.
- * It is not *eventually periodic*. No (infinite) suffix of the sequence consists of a finite string repeated infinitely.
- Your challenge is to output a Sturmian sequence of your own choosing.
- You may output an infinite sequence in any of the following ways:
- - Output an infinite list or some sort of lazy sequence structure.
- - Print the terms of the sequence in order indefinitely.
- - Take an input $n$ and output the $n$th term of your sequence. ($1$ indexing is permitted)
- - Take an input $n$ and output the first $n$ terms of your sequence.
- This is code-golf, so the goal is to minimize the size of your source code as measured in bytes.
#1: Initial revision
Output a Sturmian sequence
A [Sturmian sequence](https://en.wikipedia.org/wiki/Sturmian_word) is an infinite binary sequence satisfying two properties: * It is *balanced*. This can be stated a number of equivalent ways: * There is no pair of equal length subwords whose digit sums differ by more than 2. * There is no string $w$ such that $0w0$ and $1w1$ are both substrings. * It is not *eventually periodic*. No (infinite) suffix of the sequence consists of a finite string repeated infinitely. Your challenge is to output a Sturmian sequence of your own choosing. You may output an infinite sequence in any of the following ways: - Output an infinite list or some sort of lazy sequence structure. - Print the terms of the sequence in order indefinitely. - Take an input $n$ and output the $n$th term of your sequence. ($1$ indexing is permitted) - Take an input $n$ and output the first $n$ terms of your sequence. This is code-golf, so the goal is to minimize the size of your source code as measured in bytes.
