Equations
- Kolakoski.alt₅' n = (have xs := []; have x := -1; have y := -1; do let __s ← forIn [:n] (xs, x, y) fun (x : ℕ) (__s : List ℕ × ℤ × ℤ) => have xs := __s.1; have __s := __s.2; have x := __s.1; have y := __s.2; have xs := (if Odd x then 1 else 2) :: xs; have m := y &&& (y + 1).lnot; have x := x ^^^ m; have y := y + ↑1 ||| m &&& x >>> 1; pure (ForInStep.yield (xs, x, y)) have xs : List ℕ := __s.1 pure xs.reverse).run
Instances For
Equations
- Kolakoski.alt₅ n = (Kolakoski.alt₅' (n + 1))[n]!