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 A171588 #47 May 24 2025 16:18:15 %S A171588 0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1, %T A171588 0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,1, %U A171588 0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1 %N A171588 The Pell word: Fixed point of the morphism 0->001, 1->0. %C A171588 From _Peter Bala_, Nov 22 2013: (Start) %C A171588 This is a Sturmian word: equals the limit word S(infinity) where S(0) = 0, S(1) = 001 and for n >= 1, S(n+1) = S(n)S(n)S(n-1). See the examples below. %C A171588 This sequence corresponds to the case k = 2 of the Sturmian word S_k(infinity) as defined in A080764. See A159684 for the case k = 1. (End) %C A171588 Characteristic word with slope 1 - 1/sqrt(2). Since the characteristic word with slope 1-theta is the mirror image of the characteristic word with slope theta, a(n)= 1 - A080764(n) for all n. - _Michel Dekking_, Jan 31 2017 %C A171588 The positions of 0 comprise A001951 (Beatty sequence for sqrt(2)); the positions of 1 comprise A001952 (Beatty sequence for 2+sqrt(2)). - _Clark Kimberling_, May 11 2017 %C A171588 This is also the fixed point of the mapping 00->0010, 01->001, 10->010, starting with 00 [Dekking and Keane, 2022]. See A289001. - _N. J. A. Sloane_, Mar 09 2022 %D A171588 J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 284. %H A171588 Vincenzo Librandi, <a href="/A171588/b171588.txt">Table of n, a(n) for n = 1..5000</a> %H A171588 Scott Balchin and Dan Rust, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL20/Rust/rust3.html">Computations for Symbolic Substitutions</a>, Journal of Integer Sequences, Vol. 20 (2017), Article 17.4.1. %H A171588 Jean Berstel and Juhani Karhumäki, <a href="http://www-igm.univ-mlv.fr/~berstel/Articles/2003TutorialCoWdec03.pdf">Combinatorics on words-a tutorial</a>. Bull. Eur. Assoc. Theor. Comput. Sci. EATCS, 79:178-228, 2003. %H A171588 Michel Dekking, <a href="http://arxiv.org/abs/1705.08607">Substitution invariant Sturmian words and binary trees</a>, arXiv:1705.08607 [math.CO], 2017. %H A171588 Michel Dekking, <a href="http://math.colgate.edu/~integers/sjs7/sjs7.Abstract.html">Substitution invariant Sturmian words and binary trees</a>, Integers, Electronic Journal of Combinatorial Number Theory 18A (2018), #A17. %H A171588 Michel Dekking and Mike Keane, <a href="https://arxiv.org/abs/2202.13548">Two-block substitutions and morphic words</a>, arXiv:2202.13548 [math.CO], 2022. %H A171588 M. Lothaire, <a href="http://www-igm.univ-mlv.fr/~berstel/Lothaire/">Combinatorics on Words</a>. %H A171588 Wikipedia, <a href="http://en.wikipedia.org/wiki/Sturmian_word">Sturmian word</a> %F A171588 a(n) = floor((n + 1)/(2 + sqrt(2))) - floor(n /(2 + sqrt(2))). - _Peter Bala_, Nov 22 2013 %F A171588 a(n) = floor((n+1)*(1 - 1/sqrt(2))) - floor(n*(1 - 1/sqrt(2))). - _Michel Dekking_, Jan 31 2017 %e A171588 From _Peter Bala_, Nov 22 2013: (Start) %e A171588 The sequence of words S(n) begins %e A171588 S(0) = 0 %e A171588 S(1) = 001 %e A171588 S(2) = 001 001 0 %e A171588 S(3) = 0010010 0010010 001 %e A171588 S(4) = 00100100010010001 00100100010010001 0010010. %e A171588 The lengths of the words are [1, 3, 7, 17, 41, ...] = A001333 (apart from the initial term). (End) %p A171588 Digits := 50: u := evalf(2 + sqrt(2)): A171588 := n->floor((n+1)/u) - floor(n/u): seq(A171588(n), n = 1..80); # _Peter Bala_, Nov 22 2013 %t A171588 Table[Floor[(n + 1) (1 - 1/Sqrt[2]) - Floor[n (1 - 1/Sqrt[2])]], {n, 100}] (* _Vincenzo Librandi_, Jan 31 2017 *) %t A171588 Nest[Flatten[# /. {0 -> {0, 0, 1}, 1 -> {0}}] &, {0}, 6] (* _Clark Kimberling_, May 11 2017 *) %o A171588 (Magma) [Floor((n+1)*(1-1/Sqrt(2))-Floor(n*(1-1/Sqrt(2)))): n in [1..100]]; // _Vincenzo Librandi_, Jan 31 2017 %o A171588 (Python) %o A171588 from math import isqrt %o A171588 def A171588(n): return 1+isqrt(n**2>>1)-isqrt((n+1)**2>>1) # _Chai Wah Wu_, May 24 2025 %Y A171588 Cf. A000129, A001333, A001951, A001952, A003849, A080764, A159684, A289001. %K A171588 nonn,easy %O A171588 1,1 %A A171588 _Alexis Monnerot-Dumaine_, Dec 12 2009