Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A246960
Directions of the lines in the (Heighway) Dragon Curve.
7
0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 0, 3, 2, 3, 2, 1, 2, 3, 0, 3, 0, 1, 0, 3, 2, 3, 0, 3, 2, 3, 2, 1, 2, 3, 0, 3, 0, 1, 0, 3, 0, 1, 2, 1, 0, 1, 0, 3, 2, 3, 0, 3, 0, 1, 0, 3, 2, 3, 0, 3, 2, 3, 2, 1, 2, 3, 0, 3, 0, 1, 0, 3, 0, 1, 2, 1, 0, 1, 0, 3, 0, 1, 2, 1, 2, 3, 2, 1, 0, 1, 2, 1, 0, 1, 0, 3, 2, 3, 0, 3, 0, 1, 0, 3, 0
OFFSET
0,3
COMMENTS
Fixed point of the morphism: 0 --> 01, 1 --> 21, 2 --> 23, 3 --> 03.
LINKS
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
n where a(n) = 0,1,2,3 respectively: A043724, A043725, A043726, A043727.
Sequence in context: A338170 A066856 A089280 * A285200 A308567 A192099
KEYWORD
nonn,easy
AUTHOR
Robert G. Wilson v, Sep 08 2014
STATUS
approved