OFFSET
0,3
COMMENTS
Fixed point of the morphism: 0 --> 01, 1 --> 21, 2 --> 23, 3 --> 03.
LINKS
Joerg Arndt, Table of n, a(n) for n = 0..16383
Joerg Arndt, Matters Computational (The Fxtbook), pp. 88-92; image of the dragon curve on p. 89 (top): 0 for north, 1 for west, 2 for south, and 3 for east.
FORMULA
a(n) = A005811(n) mod 4. - Joerg Arndt, Sep 09 2014
a(n) = A105500(n) - 1. - Filip Zaludek, Dec 16 2016
MATHEMATICA
Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {2, 1}, 2 -> {2, 3}, 3 -> {0, 3}}] &, {0}, 7]
PROG
(Python)
def A246960(n): return (n^(n>>1)).bit_count()&3 # Chai Wah Wu, Jul 13 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Robert G. Wilson v, Sep 08 2014
STATUS
approved