ThueMorseNumbers
The Thue–Morse sequence as a lazy indexed collection.
ThueMorseNumbers, an infinite indexed collection.Details
- A lazy indexed collection: , and .
- OEIS A010060, starting exactly at its offset-0 term: .
- Not monotone; every term is or , so membership is exactly -- and are true, everything else (including ) is false.
Definition
Epsil, as the implementation runs it.
count()
PositiveInfinityunrank(_r)
Fold(Function(
[(bt_s[1] - bt_s[1] % 2) / 2, (bt_s[2] + bt_s[1] % 2) % 2],
bt_s,
bt_b,
), [_r, 0], Range(1, Floor(Log(_r + 1, 2)) + 2, 1))[2]rank(_x)
_x if _x == 0 || _x == 1 else -1valid(_x)
_x == 0 || _x == 1Enumeration
Examples
1 more kept as data, checked against the oracles See also: Count, At, Element, SternDiatomicSequence