cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A246960 Directions of the lines in the (Heighway) Dragon Curve.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Sep 08 2014

Keywords

Comments

Fixed point of the morphism: 0 --> 01, 1 --> 21, 2 --> 23, 3 --> 03.

Crossrefs

n where a(n) = 0,1,2,3 respectively: A043724, A043725, A043726, A043727.

Programs

  • Mathematica
    Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {2, 1}, 2 -> {2, 3}, 3 -> {0, 3}}] &, {0}, 7]
  • Python
    def A246960(n): return (n^(n>>1)).bit_count()&3 # Chai Wah Wu, Jul 13 2024

Formula

a(n) = A005811(n) mod 4. - Joerg Arndt, Sep 09 2014
a(n) = A105500(n) - 1. - Filip Zaludek, Dec 16 2016