Thue Constant

Author

Eric W. Weisstein
April 10, 2006

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Constants/ThueConstant.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/ThueConstant.html.

©2006 Wolfram Research, Inc. except for portions noted otherwise

Code

Thue[n_]:=Nest[Flatten[#/.{0->{1,1,1},1->{1,1,0}}]&,{0},n]

Recurrence

Thue[2]

a[n_]:=(a[n]=1 )/; (Mod[n,3]≠0)
a[n_]:=a[n]=1-a[n/3]

Array[a,10]

Iterations

StringJoin/@Map[ToString,NestList[Flatten[#/.{0->{1,1,1},1->{1,1,0}}]&,{0},4],{2}]//ColumnForm

Thue[3]

Length[{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}]

With[{n=8},N[FromDigits[Thue[n],2]/2^(3^n),1000]]

With[{prec=1000},Module[{n=Ceiling[Log[2,prec]prec/2]},N[FromDigits[Table[Mod[DigitSum[k,2],2],{k,0,n}],2]/2^(n+1),prec]]]

Recurrence Plot

Length[l=Thue[8]]

ArrayPlot[Mod[Table[l[[x]]-l[[y]],{x,128},{y,128}],2],PixelConstrained->True]

BBP-Type Formulas

Thue=With[{prec=1000},Module[{n=Ceiling[Log[2,prec]prec/2]},N[FromDigits[Table[Mod[DigitSum[k,2],2],{k,0,n}],2]/2^(n+1),prec]]]

Search

<<Utilities`Simplify`

Monitor[Do[If[(b=FindBasis[Thue,-3^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,1}],{-3^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-3^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,2,2}],{-3^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-3^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,3,3}],{-3^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-2^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,1}],{-2^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-2^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,2,2}],{-2^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-2^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,3,3}],{-2^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-1,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,0,0},{n,64},{p,1}],{-1,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-1,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,0,0},{n,64},{p,2,2}],{-1,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,-1,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,0,0},{n,64},{p,3,3}],{-1,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,1,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,0,0},{n,64},{p,2,2}],{1,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,1,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,0,0},{n,64},{p,3,3}],{1,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,2^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,1}],{2^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,2^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,2,2}],{2^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,2^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,3,3}],{2^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,3^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,1}],{3^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,3^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,2,2}],{3^k,n,p}];//Timing

Monitor[Do[If[(b=FindBasis[Thue,3^k,n,BasisPower->p,WorkingPrecision->300])=!={},Print[b]],{k,16},{n,64},{p,3,3}],{3^k,n,p}];//Timing