Blancmange Function

Author

Eric W. Weisstein
January 5, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Fractals/BlancmangeFunction.nb.

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

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

Code

Blancmange[d_]:=Module[{N=2^d,y,i,m,n},
  y[0]=0; y[N]=0;
  Do[
    y[m+2^(n-1)]=2^n+(y[m]+y[m+2^n])/2,
    {n,d,1,-1},{m,0,N-1,2^n}
  ];
  Table[y[i],{i,0,N}]
]

Firest Few Values

Table[Blancmange[n],{n,4}]//ColumnForm

Graphic

V5

Show[GraphicsArray[Partition[Table[ListPlot[Blancmange[d],PlotJoined->True,Ticks->None,AxesOrigin->{1,0},DisplayFunction->Identity],{d,1,6}],3]] DisplayFunction->$DisplayFunction]

ListPlot[Blancmange[10],PlotJoined->True,Ticks->None]

V6

ListPlot[Blancmange[10],Joined->True,Ticks->None]