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.
%I A346070 #74 Feb 25 2025 06:03:22 %S A346070 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,0,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,1,0,1, %T A346070 0,2,0,1,0,3,0,1,0,2,0,1,0,0,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,2,0,1,0,2, %U A346070 0,1,0,3,0,1,0,2,0,1,0,0,0,1,0,2,0,1,0 %N A346070 Symbolic code for the corner turns in the Lévy dragon curve. %C A346070 We consider the Lévy dragon curve as constructed using line segments starting with an initial horizontal segment. The left endpoint of this segment is considered the beginning of the curve. Let L(k) denote the k-th iteration. It consists of 2^k segments and 2^k-1 corners. To get the next iteration, L(k+1), each of the segments in L(k) is replaced by two segments at right angles, always placing those segments towards the left of the segment in L(k). %C A346070 Each iteration can be represented symbolically by a sequence consisting of the integers 0, 1, 2, and 3. One can imagine moving along the individual segments making up the curve starting at the left endpoint. A corner is labeled 0 if the curve makes a right turn there of 90 degrees, is labeled 2 if the curve makes a left turn of 90 degrees at that corner, is labeled 1 if the curve continues straight at that corner (0 degree turn), and is labeled 3 if the curve makes a 180-degree turn at that corner. The Lévy dragon is equal to the limit of L(k) as k goes to infinity. %C A346070 It makes sense, as Knuth and Davis remarked in their article about the Heighway dragon, to express the Lévy dragon as the infinite sequence of 0's, 1's, 2's, and 3's obtained as each finite sequence for L(k) is extended to the limit. Then a(n) is the code for the behavior of the n-th corner in this infinite sequence. %D A346070 Paul Lévy, "Plane or space curves and surfaces consisting of parts similar to the whole," in Classics on Fractals, Gerald A. Edgar, Editor, Addison-Wesley, 181-239. %H A346070 Paolo Xausa, <a href="/A346070/b346070.txt">Table of n, a(n) for n = 1..16384</a> (terms 1..4095 from Larry Riddle) %H A346070 Paul Lévy, <a href="https://gallica.bnf.fr/ark:/12148/bpt6k57344323/f53.image">Les courbes planes ou gauches et les surfaces composées de parties semblables au tout</a>, Journal de l'École Polytechnique, July 1938 pages 227-247, and <a href="https://gallica.bnf.fr/ark:/12148/bpt6k57344820/f3.image">continued</a> October 1938 pages 249-292, curve C. %H A346070 Larry Riddle, <a href="https://larryriddle.agnesscott.org/ifs/levy/LevyCode.htm">Representing the Levy Dragon Curve Symbolically</a> %H A346070 Larry Riddle, <a href="https://larryriddle.agnesscott.org/ifs/levy/Levy1234codes5.png">First 31 terms</a>, where R=0, S=1, L=2, and B=3. %H A346070 Micah D. Tillman, <a href="https://arxiv.org/abs/2502.15743">How Prime Factors Form Fractals</a>, arXiv:2502.15743 [math.GM], 2025. %H A346070 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A346070 a(n) = (A092412(n) - 1) mod 4. %F A346070 a(2n-1) = 0, a(2n) = (a(n)+1) mod 4 = A092412(n). %F A346070 Write n = k*4^m where k is not a multiple of 4. If k is odd, then a(n) = (2m) mod 4, and if k is even, then a(n) = (2m+1) mod 4. %F A346070 a(n) = A007814(n) mod 4. %e A346070 The first 15 terms correspond to iteration L(4) of the Levy dragon curve. These terms are 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0. The initial direction of the curve is 4*45=180 degrees (due west). The 15 terms indicate that the curve follows the pattern shown below. %e A346070 -- -- -- -- %e A346070 | || | %e A346070 -- -- %e A346070 | | %e A346070 | | %e A346070 -- * -- %e A346070 start %t A346070 Mod[IntegerExponent[Range[100], 2], 4] (* _Paolo Xausa_, Feb 25 2025 *) %o A346070 (Python) %o A346070 def A346070(n): return (~n & n-1).bit_length() & 3 # _Chai Wah Wu_, Jul 01 2022 %Y A346070 Cf. A092412 (essentially the same), A007814. %K A346070 easy,nonn %O A346070 1,4 %A A346070 _Larry Riddle_, Jul 04 2021