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.

This page as a plain text file.
%I A246960 #20 Jul 13 2024 17:50:59
%S A246960 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,
%T A246960 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,
%U A246960 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
%N A246960 Directions of the lines in the (Heighway) Dragon Curve.
%C A246960 Fixed point of the morphism: 0 --> 01, 1 --> 21, 2 --> 23, 3 --> 03.
%H A246960 Joerg Arndt, <a href="/A246960/b246960.txt">Table of n, a(n) for n = 0..16383</a>
%H A246960 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, 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.
%F A246960 a(n) = A005811(n) mod 4. - _Joerg Arndt_, Sep 09 2014
%F A246960 a(n) = A105500(n) - 1. - _Filip Zaludek_, Dec 16 2016
%t A246960 Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {2, 1}, 2 -> {2, 3}, 3 -> {0, 3}}] &, {0}, 7]
%o A246960 (Python)
%o A246960 def A246960(n): return (n^(n>>1)).bit_count()&3 # _Chai Wah Wu_, Jul 13 2024
%Y A246960 Cf. A014577, A106665.
%Y A246960 n where a(n) = 0,1,2,3 respectively: A043724, A043725, A043726, A043727.
%K A246960 nonn,easy
%O A246960 0,3
%A A246960 _Robert G. Wilson v_, Sep 08 2014