Ternary Champernowne Constant

Author

Eric W. Weisstein
June 30, 2013

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

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

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

Code

ChampernowneN[b_,n_]:=Module[{d=Flatten[IntegerDigits[#,b]&/@Range[n]]},
SetPrecision[FromDigits[{d,0},b],Length[d]Log[b]/2.]
]

Champernowne2[b_,n_]:=Flatten[IntegerDigits[#,b]&/@Range[n]]
Champernowne[b_,n_:Infinity]:=Sum[Ch[b,k]/b^S[b,k],{k,n}]
Ch[b_,n_]:=Module[{k},Sum[k b^(-n(k-(b^(n-1)-1))),{k,b^(n-1),b^n-1}]]
S[b_,n_]:=Module[{k},Sum[k(b-1)b^(k-1),{k,0,n-1}]]

Value

N[ChampernowneNumber[3],1000]

BaseForm[ChampernowneN[3,5],3]

BaseForm[ChampernowneN[3,10],3]

RealDigits[ChampernowneN[3,20],3]

ChampernowneN[3,100]

Prepend@@RealDigits[ChampernowneN[3,100]]

ContinuedFraction[ChampernowneN[3,1000]]