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 A159684 #57 Mar 24 2025 12:47:18 %S A159684 0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0, %T A159684 0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0, %U A159684 0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0 %N A159684 Sturmian word: limit S(infinity) where S(0) = 0, S(1) = 0,1 and for n>=1, S(n+1) = S(n)S(n)S(n-1). %C A159684 Fixed point of morphism 0 -> 0,1; 1 -> 0,1,0. %C A159684 This sequence corresponds to the case k = 1 of the Sturmian word S_k(infinity) as defined in A080764. See A171588 for the case k = 2. - _Peter Bala_, Nov 22 2013 %C A159684 This sequence is the {1->01}-transform of the Sturmian word A080764. - _Clark Kimberling_, May 17 2017 %C A159684 Also, sequence (1 if x/sqrt(2) is integer, 0 else) as x runs over the elements of N U N*sqrt(2) in increasing order, N = {0, 1, 2, ...}. See A144612 for the sqrt(3) analog. - _M. F. Hasler_, Feb 06 2025 %H A159684 Reinhard Zumkeller, <a href="/A159684/b159684.txt">Table of n, a(n) for n = 0..10000</a> %H A159684 W. W. Adams and J. L. Davison, <a href="http://www.jstor.org/stable/2041889">A remarkable class of continued fractions</a>, Proc. Amer. Math. Soc. 65 (1977), 194-198. %H A159684 P. G. Anderson, T. C. Brown, and P. J.-S. Shiue, <a href="http://people.math.sfu.ca/~vjungic/tbrown/tom-28.pdf">A simple proof of a remarkable continued fraction identity</a> Proc. Amer. Math. Soc. 123 (1995), 2005-2009. %H A159684 Jeffrey Shallit, <a href="http://cs.uwaterloo.ca/~shallit/papers.html">Characteristic words as fixed points of homomorphisms</a>, University of Waterloo Technical Report CS-91-72, 1991. See Example 1. %H A159684 Jeffrey Shallit, <a href="/A005614/a005614.ps">Characteristic words as fixed points of homomorphisms</a>. See Example 1. [Cached copy, with permission] %H A159684 N. J. A. Sloane, <a href="/A115004/a115004.txt">Families of Essentially Identical Sequences</a>, Mar 24 2021 (Includes this sequence) %H A159684 Vincent Van Dongen, <a href="https://arxiv.org/abs/2503.11682">Tileset As: 3 squares with local rules for non-periodic tiling</a>, arXiv:2503.11682 [math.GM], 2025. See p. 5. %H A159684 Wikipedia, <a href="http://en.wikipedia.org/wiki/Sturmian_word">Sturmian word</a> %F A159684 From _Peter Bala_, Nov 22 2013: (Start) %F A159684 a(n) = floor((n + 2)*(sqrt(2) - 1)) - floor((n + 1)*(sqrt(2) - 1)). %F A159684 If we read the sequence as the decimal constant C = 0.01010 01010 01010 10010 10010 ... then C = sum {n >= 1} 1/10^floor(n*(1 + sqrt(2))). %F A159684 The real number 9*C has the simple continued fraction expansion [0; 11, 1010, 10000100, 100000000000100000, 100000000000000000000000000001000000000000, ...], the partial quotients having the form 10^Pell(n)*(1 + 10^Pell(n+1)) = 10^A001333(n+1) + 10^A000129(n) (see Adams and Davison). %F A159684 A rapidly converging series for C is C = 9*sum {n >= 1} 10^Pell(2*n-1)*(1 + 10^Pell(2*n))/( (10^Pell(2*n-1) - 1)*(10^Pell(2*n+1) - 1) ): for example, the first 10 terms of the series give a rational approximation to C accurate to more than 130 million decimal places. Compare with the Fibonacci words A005614 and A221150. (End) %e A159684 0 -> 0,1 -> 0,1,0,1,0 -> 0,1,0,1,0,0,1,0,1,0,0,1 ->... %t A159684 Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {0, 1, 0}}] &, {1}, 6] (* _Robert G. Wilson v_, May 02 2009 *) %t A159684 SubstitutionSystem[{0->{0,1},1->{0,1,0}},{1},{6}][[1]] (* _Harvey P. Dale_, Dec 25 2021 *) %o A159684 (Haskell) %o A159684 a159684 n = a159684_list !! n %o A159684 a159684_list = 0 : concat (iterate (concatMap s) [1]) %o A159684 where s 0 = [0,1]; s 1 = [0,1,0] %o A159684 -- _Reinhard Zumkeller_, Oct 26 2013 %o A159684 (Python) %o A159684 def aupto(nn): %o A159684 Snm1, Sn = [0], [0, 1] %o A159684 while len(Sn) < nn+1: Snm1, Sn = Sn, Sn + Sn + Snm1 %o A159684 return Sn[:nn+1] %o A159684 print(aupto(104)) # _Michael S. Branicky_, Jul 23 2022 %o A159684 (Python) %o A159684 from math import isqrt %o A159684 def A159684(n): return -isqrt(m:=(n+1)**2<<1)+isqrt(m+(n<<2)+6)-1 # _Chai Wah Wu_, Aug 03 2022 %Y A159684 See A188037 for another version of this sequence. - _N. J. A. Sloane_, Mar 22 2011 %Y A159684 Cf. A000129, A001333, A005614, A080764, A119812, A171588, A221150, A221151, A221152, A096270. %Y A159684 The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A003151 as the parent: A003151, A001951, A001952, A003152, A006337, A080763, A082844 (conjectured), A097509, A159684, A188037, A245219 (conjectured), A276862. - _N. J. A. Sloane_, Mar 09 2021 %K A159684 nonn,easy %O A159684 0,1 %A A159684 _Philippe Deléham_, Apr 19 2009 %E A159684 More terms from _Robert G. Wilson v_, May 02 2009