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 A116178 #43 Jun 23 2025 10:54:37 %S A116178 0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0, %T A116178 1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1, %U A116178 1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1,1 %N A116178 Stewart's choral sequence: a(3n) = 0, a(3n-1) = 1, a(3n+1) = a(n). %C A116178 The sequence is cubefree, i.e., it contains no substrings of the form XXX where X is a sequence of 0's and 1's. %C A116178 The sequence is the same as the infinite binary word w(infty) generated by w(n+1)=w(n)w(n)w*(n), where n is in {0,1,2,...}, w(0)=0 and w*(n) is w(n) with the middle letter changed. (Example: w*(0)=1, w(1)=001, w*(1)=011, w(2)=001001011.) - Joel Reyes Noche (joel.noche(AT)up.edu.ph), Mar 24 2008 %C A116178 The sequence is the fixed point of the morphism 0->001, 1->011, starting from a(0) = 0. - Joel Reyes Noche (joel.noche(AT)up.edu.ph), Apr 28 2008 %C A116178 A generalized choral sequence c(3n+r_0)=0, c(3n+r_1)=1, c(3n+r_c)=c(n), with r_0=0, r_1=2, and r_c=1. - Joel Reyes Noche (joel.noche(AT)up.edu.ph), Jul 09 2009 %C A116178 It is an infinite Lyndon word; it has an infinite number of prefixes which are Lyndon words (0, 001, 001001011, etc.). - Joel Reyes Noche (joel.noche(AT)up.edu.ph), Nov 01 2009 %C A116178 This sequence (with offset 1) is given by a(3k-2)=0, a(3k-1)=a(k), a(3k)=1-a(k) for k>=1, a(0)=0; for sequences generated by such recurrences, see A189628. - _Clark Kimberling_, Apr 28 2011 %C A116178 Van der Waerden's theorem tells us there can be no infinite binary word avoiding a monochromatic arithmetic progression of length 5 (the longest is of length 177; see A121894). However, Stewart's choral sequence has the property that it has no ababa appearing in arithmetic progression, for a different from b. - _Jeffrey Shallit_, Jul 03 2020 %D A116178 J.R. Noche, On Stewart's Choral Sequence, Gibon, 8 (2008), 1-5. [From Joel Reyes Noche (joel.noche(AT)up.edu.ph), Aug 20 2008] %D A116178 J. R. Noche, Generalized Choral Sequences, Matimyas Matematika, 31 (2008), 25-28. [From Joel Reyes Noche (joel.noche(AT)up.edu.ph), Jul 09 2009] %D A116178 Ian Stewart, How to Cut a Cake and Other Mathematical Conundrums, Chapter 6. %H A116178 Antti Karttunen, <a href="/A116178/b116178.txt">Table of n, a(n) for n = 0..19683</a> %H A116178 F. M. Dekking, <a href="https://arxiv.org/abs/2001.08915">Permutations of N generated by left-right filling algorithms</a>, arXiv:2001.08915 [math.CO], 2020. %H A116178 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 A116178 Robbert Fokkink and Gandhar Joshi, <a href="https://arxiv.org/abs/2506.13337">Anti-recurrence sequences</a>, arXiv:2506.13337 [math.NT], 2025. See pp. 12, 18. %F A116178 a(3*n) = 0, a(3*n-1) = 1 and a(3*n+1) = a(n). %F A116178 G.f.: x^2/(1-x^3) +x^7/(1-x^9) +x^22/(1-x^27) +... . a(-1-n) = 1-a(n). - _Michael Somos_, Apr 17 2007 %F A116178 a(k)=1 if k=3^{m+1}n+(1/2)(5*3^m-1) and a(k)=0 if k=3^{m+1}n+(1/2)(3^m-1) for m,n in {0,1,2,...}. - Joel Reyes Noche (joel.noche(AT)up.edu.ph), Mar 24 2008 %t A116178 t = Nest[Flatten[# /. {0->{0,0,1}, 1->{0,1,1}}] &, {0}, 5] (*A116178*) %t A116178 f[n_] := t[[n]] %t A116178 Flatten[Position[t, 0]] (*A189636*) %t A116178 Flatten[Position[t, 1]] (*A189637*) %t A116178 s[n_] := Sum[f[i], {i, 1, n}]; s[0] = 0; %t A116178 Table[s[n], {n, 1, 120}] (*A189638*) %t A116178 (* _Clark Kimberling_, Apr 24 2011 *) %o A116178 (PARI) {a(n)= if(n<0, 1-a(-1-n), if(n%3==0, 0, if(n%3==2, 1, a(n\3))))} /* _Michael Somos_, Apr 17 2007 */ %Y A116178 Cf. A010060, A189636, A189637, A189638, A121894. %K A116178 easy,nonn %O A116178 0,1 %A A116178 Richard Forster (gbrl01(AT)yahoo.co.uk), Apr 15 2007 %E A116178 Formula added to the name by _Antti Karttunen_, Aug 31 2017