Sierpiński Sieve

Author

Eric W. Weisstein
February 2, 2011

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

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

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

Initialization

Plot

V5

Show[GraphicsArray[Table[Show[Gasket[n],DisplayFunction->Identity,AspectRatio->Automatic],{n,0,4}]]]

Show[GraphicsArray[Table[Show[Sierpinski[i],AspectRatio->Automatic,DisplayFunction->Identity],{i,4}]],DisplayFunction->$DisplayFunction]

GraphicsRow[Prepend[Graphics/@Table[SierpinskiGasket[n],{n,4}],SierpinskiGasket[0]]]

Mod 2

Show[GraphicsArray[
Graphics[PascalGasket[3,#],AspectRatio->Automatic]&/@
{
(Mod[Binomial[#1,#2],2]&),
Binomial,
(BitAnd[BitNot[#1],#2]&)
}
],ImageSize->500,GraphicsSpacing->-.02
]

Formuals

LSB

e[j_,n_]:=Flatten[Position[Reverse[IntegerDigits[n,2]],1]]-1

Table[Times@@(2^(2^e[j,n])+1),{n,0,10}]

BitAnd[BitNot[n],k] mod 2

Flatten[Table[BitAnd[BitNot[n],k],{n,0,10},{k,0,n}]]

ColumnForm[1-Table[Mod[BitAnd[BitNot[n],k],2],{n,0,10},{k,0,n}],Center]

ColumnForm[Table[1-IntegerDigits[BitAnd[BitNot[n],k],2,1][[1]],{n,0,10},{k,0,n}],Center]

Flatten[Table[1-IntegerDigits[BitAnd[BitNot[n],k],2,1][[1]],{n,0,10},{k,0,n}]]

XOR

a[1]:=1
a[n_]:=a[n]=BitXor[a[n-1],2a[n-1]]

a/@Range[20]

Elementary Cellular Automaton

Export[gifs<>"sier90.gif",Show[PixelPerfect[1-ElementaryCellularAutomaton[90,128],BlockSize->2]]]//Timing

Show[GraphicsArray[Partition[
Block[{$DisplayFunction=Identity},ElementaryCADiagram/@{60,90,102}],
2,2,{1,1},{}]],ImageSize->500]

Wolfram (2002, pp. 931–932)

Show[GraphicsArray[ListDensityPlot[#,Frame->False,
DisplayFunction->Identity]&/@Table[Mod[Array[Binomial,{2,2}^n,0],2],{n,5}]]]

Table[DisplayForm[Nest[SubsuperscriptBox[#,#,#]&,"*",n]],{n,5}]

Constructible Odd Polygons

Divisors[Times@@FermatPrimes]

{1,3,5,15,17,51,85,255,257,771,1285,3855,4369,13107,21845,65535,65537,196611,327685,983055,1114129,3342387,5570645,16711935,16843009,50529027,84215045,252645135,286331153,858993459,1431655765,4294967295}

Map[Apply[Times, #] &, Map[Max[#, 1] &, Map[Table[2^(2^n) + 1, {n, 5, 0, -1}] # &, Map[IntegerDigits[#, 2, 6] &, Range[0, 2^6 - 1]]], {2}]]