OFFSET
0,1
COMMENTS
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
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
a(0) = 0; then fixed point of the morphism 1->110, 0->111, starting with a(1) = 1. - Philippe Deléham, Mar 21 2004
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
Multiplicative with a(3^e) = (e+1)%2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 10 2005
1 if the ternary representation of n has an even number of trailing zeros. - Ralf Stephan, Sep 02 2013
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..100000
Joerg Arndt, Matters Computational (The Fxtbook), section 38.2, pp.730-731
Michael Gilleland, Some Self-Similar Integer Sequences
Eric Weisstein's World of Mathematics, Thue Sequence
Eric Weisstein's World of Mathematics, Thue Constant
FORMULA
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
a(0)=0, a(3k)=1-a(k); a(3k+1)=a(3k+2)=1. - Benoit Cloitre, Mar 19 2004
a(n) = 1 - A007949(n) mod 2 for n>0. - Reinhard Zumkeller, Oct 04 2008
Let T(x) be the g.f., then T(x) + T(x^3) = x/(1-x). - Joerg Arndt, May 11 2010
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/4. - Amiram Eldar, Jul 13 2020
EXAMPLE
Start: 1
Rules:
1 --> 110
0 --> 111
-------------
0: (#=1)
1
1: (#=3)
110
2: (#=9)
110110111
3: (#=27)
110110111110110111110110110
4: (#=81)
110110111110110111110110110110110111110110111110110110110110111110110111110110111
- Joerg Arndt, Jul 06 2011
MATHEMATICA
Nest[ Flatten[ # /. {0 -> {1, 1, 1}, 1 -> {1, 1, 0}}] &, {0}, 6] (* Robert G. Wilson v, Mar 09 2005 *)
PROG
(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))));
(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
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved