A014578 Binary expansion of Thue constant (or Roth's constant).
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, 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, 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
Offset: 0
Examples
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
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
- Index entries for characteristic functions
- Index entries for sequences that are fixed points of mappings
Programs
-
Mathematica
Nest[ Flatten[ # /. {0 -> {1, 1, 1}, 1 -> {1, 1, 0}}] &, {0}, 6] (* Robert G. Wilson v, Mar 09 2005 *)
-
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
-
Python
from sympy import multiplicity def A014578(n): return multiplicity(3,n)&1^1 if n else 0 # Chai Wah Wu, Jan 28 2025
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
Comments