Devil's Staircase

Author

Eric W. Weisstein
January 17, 2009

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/DevilsStaircase.nb.

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

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

Mode Locking-Version

f[{omega_,t_}]:={omega,t+omega-Sin[2Pi t]/(2Pi)};
WindingNumber[n_,{omega_,t_}]:=(Nest[f,{omega,t},n][[2]]-t)/n;

ListPlot[Table[{omega,WindingNumber[1000,{omega,0}]},{omega,0,1,.002}],Joined->True,PlotStyle->Red,AxesLabel->{Ω,W[Ω]}]//Timing

Bailey and Crandall's Version

f[x_]:=Sum[Floor[n x]/2^n,{n,∞}]

Sum[Floor[n x]/2^n,{n,∞}]

Sum[(1/(2^(m/x))),{m,∞}]

Sum[(1/(2^(Floor[m/x]))),{m,1,∞}]//Timing

With[{x=#},Sum[(1/(2^(Floor[m/x]))),{m,1,∞}]]&/@{1/2,1,1.23,2}

f/@{0,1/4,1/3,1/2,2/3,3/4,1}

Timing[pts=Table[{x,f[x]//N},{x,.001,1,.001}];]

ListPlot[pts,Joined->True,AxesLabel->TraditionalForm/@{x,f[x]},PlotStyle->Red]

f[1/GoldenRatio]/. Sum:>NSum

Sum[Floor[n/GoldenRatio]/2^n,{n,∞}]

NSum[Floor[n/GoldenRatio]/2^n,{n,∞},WorkingPrecision->100]

ContinuedFraction[%]

FromContinuedFraction[Prepend[2^(Fibonacci/@Range[0,10]),0]]//N