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 A014578 #63 Feb 16 2025 08:32:33 %S A014578 0,1,1,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0, %T A014578 1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1,1,1,0,1, %U A014578 1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1,1,1,1,0,1,1,0,1,1 %N A014578 Binary expansion of Thue constant (or Roth's constant). %C A014578 a(0)=0; to construct the sequence start with a(1)=1, then concatenate twice and change the last term 1->0 giving 1,1,0. Concatenate those 3 terms twice giving 1,1,0,1,1,0,1,1,0, change the last term 0->1 giving 1,1,0,1,1,0,1,1,1. Concatenate those 9 terms twice and change the last term 1->0, etc. - _Benoit Cloitre_, Feb 09 2003 %C A014578 It is probably my fault if this constant is misattributed. It was "computed" circa 1971 by a very simple Life pattern (as a diagonal row of blinkers), an obvious case of the (Thue-Siegel-)Roth criterion for transcendence, since the error after 3^n bits is ~2^-3^(n+1) = O(denominator^-3). I probably should have called it Roth's constant. - _Bill Gosper_, Mar 19 2004 %C A014578 a(0) = 0; then fixed point of the morphism 1->110, 0->111, starting with a(1) = 1. - _Philippe Deléham_, Mar 21 2004 %C A014578 Characteristic function of A007417, i.e., a(n) = 1 if n is in A007417 and a(n) = 0 otherwise. - _Philippe Deléham_, Mar 21 2004 %C A014578 Multiplicative with a(3^e) = (e+1)%2, a(p^e) = 1 otherwise. - _David W. Wilson_, Jun 10 2005 %C A014578 a(A145204(n)) = 0, a(A007417(n)) = 1. - _Reinhard Zumkeller_, Oct 04 2008 %C A014578 1 if the ternary representation of n has an even number of trailing zeros. - _Ralf Stephan_, Sep 02 2013 %H A014578 Antti Karttunen, <a href="/A014578/b014578.txt">Table of n, a(n) for n = 0..100000</a> %H A014578 Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, section 38.2, pp.730-731 %H A014578 Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a> %H A014578 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ThueSequence.html">Thue Sequence</a> %H A014578 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ThueConstant.html">Thue Constant</a> %H A014578 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a> %H A014578 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A014578 a(0)=0; for n>=1, a(n)=sum(k>=0, (-1)^k*(floor(n/3^k)-floor((n-1)/3^k))). - _Benoit Cloitre_, Jun 03 2003 %F A014578 a(0)=0, a(3k)=1-a(k); a(3k+1)=a(3k+2)=1. - _Benoit Cloitre_, Mar 19 2004 %F A014578 Sum_{k=0..3^n} a(k) = A015518(n+1) = (-1)^n*A014983(n+1). - _Philippe Deléham_, Mar 31 2004 %F A014578 a(n) = 1 - A007949(n) mod 2 for n>0. - _Reinhard Zumkeller_, Oct 04 2008 %F A014578 Let T(x) be the g.f., then T(x) + T(x^3) = x/(1-x). - _Joerg Arndt_, May 11 2010 %F A014578 Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/4. - _Amiram Eldar_, Jul 13 2020 %e A014578 Start: 1 %e A014578 Rules: %e A014578 1 --> 110 %e A014578 0 --> 111 %e A014578 ------------- %e A014578 0: (#=1) %e A014578 1 %e A014578 1: (#=3) %e A014578 110 %e A014578 2: (#=9) %e A014578 110110111 %e A014578 3: (#=27) %e A014578 110110111110110111110110110 %e A014578 4: (#=81) %e A014578 110110111110110111110110110110110111110110111110110110110110111110110111110110111 %e A014578 - _Joerg Arndt_, Jul 06 2011 %t A014578 Nest[ Flatten[ # /. {0 -> {1, 1, 1}, 1 -> {1, 1, 0}}] &, {0}, 6] (* _Robert G. Wilson v_, Mar 09 2005 *) %o A014578 (PARI) a(n)=if(n<1,0,sum(k=0,ceil(log(n)/log(3)),(-1)^k*(floor(n/3^k)-floor((n-1)/3^k)))); %o A014578 (PARI) A014578(n) = if(!n,n,valuation(n, 3)%2==0); \\ _Ralf Stephan_, Sep 02 2013, edited for the term a(0)=0 - _Antti Karttunen_, May 28 2024 %o A014578 (Python) %o A014578 from sympy import multiplicity %o A014578 def A014578(n): return multiplicity(3,n)&1^1 if n else 0 # _Chai Wah Wu_, Jan 28 2025 %Y A014578 Cf. Thue-Morse or parity constant A010060. %Y A014578 Cf. A154271. %K A014578 nonn,cons,mult %O A014578 0,1 %A A014578 _Eric W. Weisstein_