Cell[CellGroupData[{Cell[BoxData[ RowBox[{ RowBox[{"siergask", "[", "n_", "]"}], ":=", " ", RowBox[{"Nest", "[", RowBox[{ RowBox[{ RowBox[{"Flatten", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", " ", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], ",", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "+", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", "2"}], ",", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "+", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}]}], ")"}], "/", "2"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "+", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}]}], ")"}], "/", "2"}], ",", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], ",", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "+", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}]}], ")"}], "/", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}], "+", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}]}], ")"}], "/", "2"}], ",", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "+", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}]}], ")"}], "/", "2"}], ",", " ", RowBox[{"#", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}]}], "}"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "#", "]"}]}], "}"}]}], "]"}], ",", "1"}], "]"}], "&"}], ",", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"1", "/", "2"}], ",", "1"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], "}"}], "}"}], ",", "n"}], "]"}]}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, {3.3931745109115973`*^9, 3.3931746178959723`*^9}, {3.3931747401928473`*^9, 3.3931747510053473`*^9}, {3.3931748065990973`*^9, 3.3931748153647223`*^9}, {3.3931748484428473`*^9, 3.3931748769740973`*^9}, 3.3931749285209723`*^9, { 3.3931749963490973`*^9, 3.3931750092397223`*^9}, { 3.3931750460053473`*^9, 3.3931750492709723`*^9}, { 3.3931786082719283`*^9, 3.393178707462844*^9}, 3.393182064130989*^9, 3.760797444762041*^9}, CellID->108180696], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Opacity", "[", "opacity", "]"}], ",", "Purple", ",", " ", RowBox[{"Map", "[", RowBox[{"Polygon", ",", " ", RowBox[{"siergask", "[", "n", "]"}], ",", "1"}], "]"}]}], "}"}], ",", " ", RowBox[{"AspectRatio", " ", "->", " ", "1"}]}], "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "1", ",", "\"\\""}], "}"}], ",", "0", ",", "5", ",", "1", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"opacity", ",", "1"}], "}"}], ",", ".1", ",", "1"}], "}"}], ",", RowBox[{"SaveDefinitions", "->", "True"}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, {3.3919823506428213`*^9, 3.391982377786087*^9}, {3.3919852620557137`*^9, 3.391985288677309*^9}, {3.391985599543436*^9, 3.391985601626761*^9}, 3.392382832705982*^9, { 3.3923943435451293`*^9, 3.3923943539434566`*^9}, { 3.392394426683473*^9, 3.3923944399975805`*^9}, { 3.3931820764746604`*^9, 3.3931820818340015`*^9}, 3.7607974447590103`*^9}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`n$$ = 1, $CellContext`opacity$$ = 1, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`n$$], 1, "steps"}, 0, 5, 1}, {{ Hold[$CellContext`opacity$$], 1}, 0.1, 1}}, Typeset`size$$ = { 360., {178., 182.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`n$199005$$ = 0, $CellContext`opacity$199006$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`n$$ = 1, $CellContext`opacity$$ = 1}, "ControllerVariables" :> { Hold[$CellContext`n$$, $CellContext`n$199005$$, 0], Hold[$CellContext`opacity$$, $CellContext`opacity$199006$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Show[ Graphics[{ Opacity[$CellContext`opacity$$], Purple, Map[Polygon, $CellContext`siergask[$CellContext`n$$], 1]}, AspectRatio -> 1]], "Specifications" :> {{{$CellContext`n$$, 1, "steps"}, 0, 5, 1, Appearance -> "Labeled"}, {{$CellContext`opacity$$, 1}, 0.1, 1}}, "Options" :> {}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{405., {237., 243.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`siergask[ Pattern[$CellContext`n, Blank[]]] := Nest[Flatten[ Table[{{ Part[#, $CellContext`i, 1], (Part[#, $CellContext`i, 1] + Part[#, $CellContext`i, 2])/ 2, (Part[#, $CellContext`i, 1] + Part[#, $CellContext`i, 3])/ 2}, {(Part[#, $CellContext`i, 1] + Part[#, $CellContext`i, 2])/2, Part[#, $CellContext`i, 2], (Part[#, $CellContext`i, 2] + Part[#, $CellContext`i, 3])/ 2}, {(Part[#, $CellContext`i, 1] + Part[#, $CellContext`i, 3])/ 2, (Part[#, $CellContext`i, 2] + Part[#, $CellContext`i, 3])/2, Part[#, $CellContext`i, 3]}}, {$CellContext`i, Length[#]}], 1]& , {{{0, 0}, {1/2, 1}, {1, 0}}}, $CellContext`n]}; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.7607974447592707`*^9}, CellID->326591774] }, {3}]]