Created
November 13, 2022 00:15
-
-
Save arnaud/ae4b5e2c6bb412fb8a274862dd1ab234 to your computer and use it in GitHub Desktop.
Thue-Morse sequence in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...Array(8)].reduce(a=>[...a,...a.map(i=>+!i)],[0]) | |
// => 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In reference to https://oeis.org/A010060