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 A156595 #53 Feb 16 2025 13:36:24 %S A156595 0,1,1,0,1,0,0,1,0,0,1,1,0,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,0,0, %T A156595 1,0,0,1,1,0,1,0,0,1,1,0,1,1,0,1,0,0,1,0,0,1,1,0,1,0,0,1,0,0,1,1,0,1, %U A156595 0,0,1,1,0,1,1,0,1,0,0,1,0,0,1,1,0,1,0,0,1,0,0,1,1,0,1,0,0,1,1,0,1,1,0,1,0 %N A156595 Fixed point of the morphism 0->011, 1->010. %C A156595 Start with 0 and apply the morphism 0->011 and 1->010 repeatedly. %C A156595 This sequence draws the Sierpinski gasket, when iterating the following odd-even drawing rule: If "1" then draw a segment forward, if "0" then draw a segment forward and turn 120 degrees right if in odd position or left if in even position. %C A156595 From _Dimitri Hendriks_, Jun 29 2010: (Start) %C A156595 This sequence is the first difference of the Mephisto Waltz A064990, i.e., a(n) = A064990(n) + A064990(n+1), where '+' is addition modulo 2. %C A156595 This sequence can also be generated as a Toeplitz word: First consider the periodic word 0,1,$,0,1,$,0,1,$,... and then fill the gaps $ by the bitwise negation of the sequence itself: 0,1,_1_,0,1,_0_,0,1,_0_,.... See the Allouche/Bacher reference for a precise definition of Toeplitz sequences. (End) %C A156595 From _Joerg Arndt_, Jan 21 2013: (Start) %C A156595 Identical to the morphism 0-> 011010010, 1->011010011 given on p. 100 of the Fxtbook (see link), because 0 -> 011 -> 011010010 and 1 -> 010 -> 011010011. %C A156595 This sequence gives the turns (by 120 degrees) of the R9-dragon curve (displayed on p. 101) which can be rendered as follows: %C A156595 [Init] Set n=0 and direction=0. %C A156595 [Draw] Draw a unit line (in the current direction). Turn left/right if a(n) is zero/nonzero respectively. %C A156595 [Next] Set n=n+1 and goto (draw). %C A156595 (End) %D A156595 M. Lothaire, Combinatorics on words. %H A156595 J.-P. Allouche and R. Bacher, <a href="http://dx.doi.org/10.5169/seals-59494">Toeplitz Sequences, Paperfolding, Towers of Hanoi, and Progression-Free Sequences of Integers</a>, L'Enseignement Mathématique, volume 38, pages 315-327, 1992. %H A156595 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a> (section 1.31.5 "Dragon curves based on radix-R counting", pp. 95-101, image on p. 101). %H A156595 Gabriele Fici and Jeffrey Shallit, <a href="https://arxiv.org/abs/2112.12125">Properties of a Class of Toeplitz Words</a>, arXiv:2112.12125 [cs.FL], 2021. %H A156595 Kevin Ryde, <a href="http://user42.tuxfamily.org/terdragon/index.html">Iterations of the Terdragon Curve</a>, see index "AltTurnRpred" with AltTurnRpred(n) = a(n-1). %H A156595 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A156595 a(3k-2)=0, a(3k-1)=1, a(3k)=1-a(k) for k>=1, a(0)=0. - _Clark Kimberling_, Apr 28 2011 %e A156595 0 -> 0,1,1 -> 0,1,1,0,1,0,0,1,0 -> ... %t A156595 Nest[ Flatten[ # /. {0 -> {0, 1, 1}, 1 -> {0, 1, 0}}] &, {0}, 10] %t A156595 SubstitutionSystem[{0->{0,1,1},1->{0,1,0}},0,{5}][[1]] (* _Harvey P. Dale_, Jan 15 2022 *) %o A156595 (Python) %o A156595 from sympy import integer_log %o A156595 def A156595(n): return sum(((m:=(n+1)//9**i)-2)//9+(m-3)//9+(m-5)//9+(m-8)//9+4 for i in range(integer_log(n+1,9)[0]+1))-sum(((m:=n//9**i)-2)//9+(m-3)//9+(m-5)//9+(m-8)//9+4 for i in range(integer_log(n,9)[0]+1)) if n else 0 # _Chai Wah Wu_, Feb 16 2025 %Y A156595 Cf. A278996 (indices of 0's), A278997 (indices of 1's), A189717 (partial sums). %Y A156595 Cf. A189628 (morphisms guide). %Y A156595 Cf. A307672 (draws curves that align with the Sierpinski gasket). %K A156595 easy,nice,nonn %O A156595 0,1 %A A156595 _Alexis Monnerot-Dumaine_, Feb 10 2009