(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 79756, 2067] NotebookOptionsPosition[ 78549, 2025] NotebookOutlinePosition[ 78889, 2040] CellTagsIndexPosition[ 78846, 2037] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "3", ",", "4", ",", "9"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "16"}], "}"}]}], "}"}], "\[IndentingNewLine]", "For", " ", "this", " ", "file"}], ",", " ", RowBox[{ "see", " ", "the", " ", "comments", " ", "added", " ", "to", " ", "music16vs24839"}], ",", " ", RowBox[{"the", " ", "same", " ", "apply", " ", RowBox[{"here", "."}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Clear", "[", "x", "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Expand", "[", RowBox[{ RowBox[{"Cyclotomic", "[", RowBox[{"2", ",", "x"}], "]"}], RowBox[{"Cyclotomic", "[", RowBox[{"4", ",", "x"}], "]"}]}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.433601683703125*^9, 3.433601737515625*^9}, { 3.43360855125*^9, 3.433608554140625*^9}}], Cell[BoxData[ RowBox[{"1", "+", "x", "+", SuperscriptBox["x", "2"], "+", SuperscriptBox["x", "3"]}]], "Output", CellChangeTimes->{3.433601743375*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "This", " ", "section", " ", "alone", " ", "is", " ", "the", " ", "\"\\"", "n", "\"\< and a set \n\>\"", "B", "\"\< at the beginning and then run it. It gives you ALL the tiling \ complements of B in the group Z_n. Try to play with it in different groups. \ Z_108, Z_120, etc. It runs remarkably fast, as long as the number of tiling \ complements is not more than a few thousand. It takes longer if it is \ something like 100000, and takes 2-3 days if it is 1000000. Please use it at \ your wish. For example it is funny to give n=1000 and a random set B of \ length 20, and see how quickly it decides whether there are any tilining \ complements of B. Of course, almost surely B will have no tiling complements, \ and this procedure will run within 1-2 minutes. \n \>"}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"{", RowBox[{"i", ",", "g", ",", " ", "mark"}], "}"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Clear", "[", RowBox[{ "n", ",", "B", ",", "R", ",", "Tile", ",", "A", ",", "U", ",", "mark", ",", "T", ",", "g"}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", "144"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"B", "=", RowBox[{"{", RowBox[{"0", ",", "1", ",", "2", ",", "3"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"B", "=", RowBox[{"B", "\[Union]", RowBox[{"(", RowBox[{"B", "+", "16"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "32"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "48"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "64"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "80"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "96"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "112"}], ")"}], "\[Union]", RowBox[{"(", RowBox[{"B", "+", "128"}], ")"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Tile", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", "1000000"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"R", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", "n"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"A", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}], ",", "n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"U", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", "1", "]"}], "]"}], "=", "B"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mark", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"1", "&"}], ",", RowBox[{ RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}], "+", "1"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"T", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{ RowBox[{"{", "0", "}"}], "&"}], ",", RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"g", "=", "1"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", " ", RowBox[{"i", ">", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], "\[Equal]", "n"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"Tile", "[", RowBox[{"[", "g", "]"}], "]"}], "=", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}]}], ";", RowBox[{"g", "=", RowBox[{"g", "+", "1"}]}], ";", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "-", "1"}], "]"}], "]"}]}], ";", RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", " ", RowBox[{"j", "\[LessEqual]", "n"}], ",", RowBox[{ RowBox[{"k", "=", "100"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"Mod", "[", RowBox[{"j", ",", "n"}], "]"}]}], "]"}], "]"}], ",", " ", RowBox[{ RowBox[{"k", "=", "0"}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"m", "=", "1"}], ",", " ", RowBox[{"m", "\[LessEqual]", RowBox[{"Length", "[", "B", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Intersection]", " ", RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"j", "-", RowBox[{"B", "[", RowBox[{"[", "m", "]"}], "]"}]}], ")"}], "+", "B"}], ",", "n"}], "]"}]}], "\[Equal]", RowBox[{"{", "}"}]}], ",", " ", RowBox[{ RowBox[{"k", "=", RowBox[{"k", "+", "1"}]}], ";", " ", RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "m"}], "]"}], "]"}], "=", RowBox[{"Mod", "[", RowBox[{ RowBox[{"j", "-", RowBox[{"B", "[", RowBox[{"[", "m", "]"}], "]"}]}], ",", "n"}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"m", "++"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"R", "[", RowBox[{"[", "j", "]"}], "]"}], "=", "k"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"min", "=", RowBox[{"Min", "[", "R", "]"}]}], ";", " ", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"(", RowBox[{"Not", "[", RowBox[{"min", "\[Equal]", "0"}], "]"}], ")"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"t", "=", RowBox[{"Catch", "[", RowBox[{"Do", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"R", "[", RowBox[{"[", "ii", "]"}], "]"}], "\[Equal]", "min"}], ",", " ", RowBox[{"Throw", "[", "ii", "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"ii", ",", "n"}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "\[LessEqual]", RowBox[{"Length", "[", "B", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"b", "=", RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}]}], ",", " ", RowBox[{"b", "<=", RowBox[{"Length", "[", "B", "]"}]}], ",", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"b", "+", "1"}]}], ";", RowBox[{"z", "=", "0"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "t", ",", "b"}], "]"}], "]"}], "\[Equal]", "200"}], "]"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", RowBox[{"i", "+", "1"}], "]"}], "]"}], "=", RowBox[{ RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Union]", RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "t", ",", "b"}], "]"}], "]"}], "+", "B"}], ",", "n"}], "]"}]}]}], ";", " ", RowBox[{ RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "+", "1"}], "]"}], "]"}], "=", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Union]", RowBox[{"{", RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "t", ",", "b"}], "]"}], "]"}], "}"}]}]}], ";", " ", RowBox[{"b", "=", RowBox[{ RowBox[{"Length", "[", "B", "]"}], "+", "1"}]}], ";", RowBox[{"z", "=", "1"}], ";", RowBox[{"i", "=", RowBox[{"i", "+", "1"}]}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"b", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"z", "==", "0"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}]}], "]"}], ";"}], "\[IndentingNewLine]", ",", " ", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "-", "1"}], "]"}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}]}], "]"}], ";"}], "\[IndentingNewLine]", ",", " ", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "-", "1"}], "]"}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}]}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Tile", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Tile", "\[Union]", RowBox[{"{", "}"}]}], ",", "1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Length", "[", "Tile", "]"}], "\[IndentingNewLine]", RowBox[{"Tile", ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.43360174859375*^9, 3.433601792546875*^9}, 3.433605680859375*^9, {3.433605733*^9, 3.4336058309375*^9}, { 3.4336064065*^9, 3.433606439921875*^9}}], Cell[BoxData[ DynamicBox[ ToBoxes[{$CellContext`i, $CellContext`g, $CellContext`mark}, StandardForm], ImageSizeCache->{754.125, {2., 8.}}]], "Output", CellChangeTimes->{3.433601794671875*^9, 3.43360568346875*^9, 3.433605832*^9}],\ Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "2", ",", "3", ",", "16", ",", "17", ",", "18", ",", "19", ",", "32", ",", "33", ",", "34", ",", "35", ",", "48", ",", "49", ",", "50", ",", "51", ",", "64", ",", "65", ",", "66", ",", "67", ",", "80", ",", "81", ",", "82", ",", "83", ",", "96", ",", "97", ",", "98", ",", "99", ",", "112", ",", "113", ",", "114", ",", "115", ",", "128", ",", "129", ",", "130", ",", "131"}], "}"}]], "Output", CellChangeTimes->{3.433601794671875*^9, 3.43360568346875*^9, 3.433605832046875*^9}], Cell[BoxData["729"], "Output", CellChangeTimes->{3.433601794671875*^9, 3.43360568346875*^9, 3.433605943921875*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "In", " ", "this", " ", "step", " ", "we", " ", "are", " ", "going", " ", "to", " ", "throw", " ", "away", " ", "the", " ", "periodic", " ", "sets", " ", "from", " ", RowBox[{"Tile", ".", " ", "And"}], " ", "also"}], ",", " ", RowBox[{ "we", " ", "want", " ", "to", " ", "keep", " ", "only", " ", "one", " ", "copy", " ", "of", " ", "equivalent", " ", "tiles", " ", RowBox[{ RowBox[{"(", RowBox[{ "a", " ", "tile", " ", "is", " ", "equivalent", " ", "to", " ", "its", " ", "own", " ", "translated", " ", "coppies"}], ")"}], ".", " ", "We"}], " ", "only", " ", "want", " ", "to", " ", "keep", " ", "the", " ", "ones", " ", "in", " ", "normal", " ", RowBox[{"form", ".", " ", "The"}], " ", "normal", " ", "form", " ", "i", " ", "chose", " ", "here", " ", "is", " ", "that", " ", "the", " ", "longest", " ", "interval", " ", "is", " ", "thrown", " ", "in", " ", "at", " ", "the", " ", RowBox[{"beginning", "."}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", " ", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "Tile", "]"}]}], ",", " ", RowBox[{ RowBox[{"P", "=", RowBox[{"Tile", "[", RowBox[{"[", "j", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "2"}], ",", " ", RowBox[{"i", "<=", RowBox[{"Length", "[", "P", "]"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"Tile", ",", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"P", "-", RowBox[{"P", "[", RowBox[{"[", "i", "]"}], "]"}]}], ",", "n"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}]}], "]"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"Tile", "[", RowBox[{"[", "j", "]"}], "]"}], "=", "0"}], ";", RowBox[{"i", "=", RowBox[{ RowBox[{"Length", "[", "P", "]"}], "+", "1"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"i", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"Tile", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Tile", "\[Union]", RowBox[{"{", "}"}]}], ",", "1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Length", "[", "Tile", "]"}], "\[IndentingNewLine]", "Tile", "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.433605918453125*^9, 3.433605920171875*^9}}], Cell[BoxData["180"], "Output", CellChangeTimes->{3.43360596171875*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "40", ",", "76", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "68", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "84", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "84", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "88", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "88", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "60", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "72", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "76", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "76", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "88", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "88", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "88", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "92", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "92", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "92", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "104", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "104", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "104", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "60", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "68", ",", "92"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "68", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "76", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "76", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "76", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "84", ",", "92"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "84", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "84", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "84", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "92", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "92", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "92", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "100", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "100", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "100", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "108", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "56", ",", "108", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "68", ",", "88"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "68", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "68", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "72", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "72", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "84", ",", "88"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "84", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "84", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "84", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "88", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "88", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "88", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "100", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "100", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "100", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "104", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "104", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "116", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "116", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "120", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "72", ",", "92"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "72", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "72", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "76", ",", "88"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "76", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "76", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "76", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "88", ",", "92"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "88", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "88", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "88", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "92", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "92", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "92", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "104", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "104", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "104", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "108", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "108", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "120", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "120", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "124", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "68", ",", "136", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "76", ",", "84"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "76", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "76", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "76", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "84", ",", "92"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "84", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "84", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "84", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "92", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "92", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "92", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "100", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "100", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "100", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "108", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "108", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "116", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "116", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "124", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "72", ",", "132", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "84", ",", "88"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "84", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "84", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "84", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "88", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "88", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "88", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "100", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "100", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "100", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "104", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "104", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "116", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "116", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "120", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "76", ",", "132", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "88", ",", "92"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "88", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "88", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "88", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "92", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "92", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "92", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "104", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "104", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "104", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "108", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "108", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "120", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "120", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "124", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "136", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "92", ",", "100"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "92", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "92", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "100", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "100", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "100", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "108", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "108", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "116", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "116", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "124", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "88", ",", "132", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "100", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "100", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "100", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "104", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "104", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "116", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "116", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "120", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "92", ",", "132", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "104", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "104", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "104", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "108", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "108", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "120", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "120", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "124", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "100", ",", "136", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "104", ",", "108", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "104", ",", "108", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "104", ",", "116", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "104", ",", "116", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "104", ",", "124", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "104", ",", "132", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "108", ",", "116", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "108", ",", "116", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "108", ",", "120", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "108", ",", "132", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "116", ",", "120", ",", "124"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "116", ",", "120", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "116", ",", "124", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "116", ",", "136", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "120", ",", "124", ",", "132"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "120", ",", "132", ",", "140"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "124", ",", "132", ",", "136"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "132", ",", "136", ",", "140"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.43360596178125*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{ RowBox[{ "This", " ", "step", " ", "is", " ", "a", " ", "seemingly", " ", "long", " ", "code"}], ",", " ", RowBox[{ RowBox[{"but", " ", RowBox[{"it", "'"}], "s", " ", "task", " ", "is", " ", RowBox[{"simple", ".", " ", "You"}], " ", "must", " ", "give", " ", "a", " ", "value", " ", "\"\\"", " ", "and", " ", "a", " ", "list", " ", "of", " ", "sets", " ", "\"\\"", " ", "at", " ", "the", " ", "beginning", " ", "as", " ", RowBox[{"input", ".", " ", "What"}], " ", "it", " ", RowBox[{"does", ":", " ", RowBox[{ "it", " ", "puts", " ", "the", " ", "sets", " ", "in", " ", "T2", " ", "into", " ", "equvalence", " ", "classes", " ", "according", " ", "to", " ", "which", " ", "cyclotomic", " ", "polynomials", " ", "divide", " ", RowBox[{"them", ".", " ", "In"}], " ", "this", " ", "case", " ", "n"}]}]}], "=", RowBox[{ RowBox[{"144", " ", "and", " ", "T2"}], "=", RowBox[{"Tile", " ", "from", " ", "the", " ", "previous", " ", RowBox[{"step", "."}]}]}]}]}], " ", "\[IndentingNewLine]", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"n", "=", "144"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"T2", "=", "Tile"}], ";"}], "\[IndentingNewLine]", " ", "\[IndentingNewLine]", RowBox[{"Dynamic", "[", RowBox[{"{", RowBox[{"j", ",", "v", ",", "vvv", ",", "vvvv"}], "}"}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Clear", "[", "H", "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Length", "[", "T2", "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"H", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Length", "[", "T2", "]"}], ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"MF", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", "100"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"MT", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", "100"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", " ", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "T2", "]"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"k", "=", "1"}], ",", " ", RowBox[{"k", "\[LessEqual]", "n"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"T2", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{"Mod", "[", RowBox[{"k", ",", "n"}], "]"}]}], "]"}], ",", RowBox[{ RowBox[{"H", "[", RowBox[{"[", RowBox[{"j", ",", "k"}], "]"}], "]"}], "=", "1"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"k", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"MF", "[", RowBox[{"[", "1", "]"}], "]"}], "=", RowBox[{"H", "[", RowBox[{"[", "1", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"MT", "[", RowBox[{"[", "1", "]"}], "]"}], "=", RowBox[{"T2", "[", RowBox[{"[", "1", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"cont", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"v", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "2"}], ",", " ", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "T2", "]"}]}], ",", " ", RowBox[{ RowBox[{"cont", "=", "1"}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"c", "=", "1"}], ",", RowBox[{"c", "\[LessEqual]", "v"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"k", "=", "1"}], ",", " ", RowBox[{"k", "\[LessEqual]", "n"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"Not", "[", RowBox[{ RowBox[{ RowBox[{"Chop", "[", RowBox[{"Fourier", "[", RowBox[{"MF", "[", RowBox[{"[", "c", "]"}], "]"}], "]"}], "]"}], "[", RowBox[{"[", "k", "]"}], "]"}], "==", RowBox[{ RowBox[{"Chop", "[", RowBox[{"Fourier", "[", RowBox[{"H", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}], "]"}], "[", RowBox[{"[", "k", "]"}], "]"}]}], "]"}], ")"}], "\[And]", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Chop", "[", RowBox[{"Fourier", "[", RowBox[{"MF", "[", RowBox[{"[", "c", "]"}], "]"}], "]"}], "]"}], "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "0"}], "\[Or]", RowBox[{ RowBox[{ RowBox[{"Chop", "[", RowBox[{"Fourier", "[", RowBox[{"H", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}], "]"}], "[", RowBox[{"[", "k", "]"}], "]"}], "\[Equal]", "0"}]}], ")"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"k", "=", RowBox[{"n", "+", "1"}]}], ";", RowBox[{"cont", "=", RowBox[{"cont", "+", "1"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"k", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"cont", "\[LessEqual]", "c"}], ",", " ", RowBox[{"c", "=", RowBox[{"v", "+", "1"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"c", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"cont", "\[Equal]", RowBox[{"v", "+", "1"}]}], ",", " ", RowBox[{ RowBox[{ RowBox[{"MF", "[", RowBox[{"[", RowBox[{"v", "+", "1"}], "]"}], "]"}], "=", RowBox[{"H", "[", RowBox[{"[", "j", "]"}], "]"}]}], ";", RowBox[{ RowBox[{"MT", "[", RowBox[{"[", RowBox[{"v", "+", "1"}], "]"}], "]"}], "=", RowBox[{"T2", "[", RowBox[{"[", "j", "]"}], "]"}]}], ";", " ", RowBox[{"v", "=", RowBox[{"v", "+", "1"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], " ", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"MT", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"MT", "\[Union]", RowBox[{"{", "}"}]}], ",", "1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"MF", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"MF", "\[Union]", RowBox[{"{", "}"}]}], ",", "1"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Length", "[", "MF", "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "MT", "\[IndentingNewLine]", "\[IndentingNewLine]", " ", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Next", ",", " ", RowBox[{ RowBox[{"we", " ", "see", " ", "what", " ", "those", " ", "Fourier"}], "-", RowBox[{"zero", " ", "sets", " ", RowBox[{"are", "."}]}]}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"J", "=", "MF"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"F1", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"1", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Length", "[", "J", "]"}], ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", RowBox[{"i", "<=", RowBox[{"Length", "[", "J", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", "n"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Chop", "[", RowBox[{"Fourier", "[", RowBox[{"J", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "[", RowBox[{"[", "j", "]"}], "]"}], "\[Equal]", "0"}], ",", " ", RowBox[{ RowBox[{"F1", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "=", "0"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"i", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"F1", ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"FF1", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Length", "[", "F1", "]"}], ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", RowBox[{"i", "\[LessEqual]", RowBox[{"Length", "[", "F1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", "n"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"F1", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "\[Equal]", "0"}], ",", " ", RowBox[{ RowBox[{"FF1", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "=", "j"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"i", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "FF1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"FF1", "[", RowBox[{"[", "j", "]"}], "]"}], "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{ RowBox[{"FF1", "[", RowBox[{"[", "j", "]"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}], ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"FF1", ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"FF", "=", RowBox[{"FF1", "-", "1"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"m", "=", "1"}], ",", RowBox[{"m", "\[LessEqual]", RowBox[{"Length", "[", "FF1", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", RowBox[{"FF1", "[", RowBox[{"[", "m", "]"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"FF", "[", RowBox[{"[", RowBox[{"m", ",", "j"}], "]"}], "]"}], "=", RowBox[{"GCD", "[", RowBox[{ RowBox[{"FF", "[", RowBox[{"[", RowBox[{"m", ",", "j"}], "]"}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"m", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"FF", ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "FF", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"FF", "[", RowBox[{"[", "j", "]"}], "]"}], "=", RowBox[{ RowBox[{"FF", "[", RowBox[{"[", "j", "]"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"FF", ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"FT", "=", RowBox[{"n", "/", "FF"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"CFT", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"Length", "[", "FT", "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "FT", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"CFT", "[", RowBox[{"[", "j", "]"}], "]"}], "=", RowBox[{"Complement", "[", RowBox[{ RowBox[{"Divisors", "[", "n", "]"}], ",", RowBox[{"FT", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "CFT", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.433605971203125*^9, 3.433606006421875*^9}, { 3.433606475421875*^9, 3.433606488953125*^9}}], Cell[BoxData[ DynamicBox[ ToBoxes[{$CellContext`j, $CellContext`v, $CellContext`vvv, \ $CellContext`vvvv}, StandardForm], ImageSizeCache->{96.5625, {2., 8.}}]], "Output", CellChangeTimes->{3.433606010046875*^9}], Cell[BoxData["180"], "Output", CellChangeTimes->{3.43360601009375*^9}], Cell[BoxData["6"], "Output", CellChangeTimes->{3.433606029296875*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "40", ",", "76", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "84", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "76", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "88", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "84", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "108", ",", "120"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.433606029296875*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"72", ",", "48", ",", "24", ",", "16", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"48", ",", "24", ",", "16", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"72", ",", "24", ",", "16", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"48", ",", "16", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"24", ",", "16", ",", "8"}], "}"}], ",", RowBox[{"{", RowBox[{"16", ",", "8"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.433606029515625*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "6", ",", "9", ",", "12", ",", "18", ",", "36", ",", "144"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "6", ",", "9", ",", "12", ",", "18", ",", "36", ",", "72", ",", "144"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "6", ",", "9", ",", "12", ",", "18", ",", "36", ",", "48", ",", "144"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "6", ",", "9", ",", "12", ",", "18", ",", "24", ",", "36", ",", "72", ",", "144"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "6", ",", "9", ",", "12", ",", "18", ",", "36", ",", "48", ",", "72", ",", "144"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "6", ",", "9", ",", "12", ",", "18", ",", "24", ",", "36", ",", "48", ",", "72", ",", "144"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.433606029515625*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{"Dynamic", "[", RowBox[{"{", RowBox[{ "jj", ",", "j", ",", "i", ",", "g", ",", " ", "mark", ",", " ", "rr"}], "}"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Clear", "[", RowBox[{ "n", ",", "J", ",", "B", ",", "R", ",", "Tile", ",", "A", ",", "U", ",", "mark", ",", "T", ",", "g", ",", "x"}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", "144"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"J", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "40", ",", "76", ",", "116"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "44", ",", "84", ",", "104"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "76", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "52", ",", "88", ",", "108"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "60", ",", "84", ",", "120"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "84", ",", "108", ",", "120"}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"rr", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"gcd", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Length", "[", "J", "]"}], ",", RowBox[{"Length", "[", RowBox[{"J", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"kk", "=", "1"}], ",", RowBox[{"kk", "\[LessEqual]", RowBox[{"Length", "[", "J", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"mm", "=", "2"}], ",", RowBox[{"mm", "\[LessEqual]", RowBox[{"Length", "[", RowBox[{"J", "[", RowBox[{"[", "kk", "]"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"gcd", "[", RowBox[{"[", RowBox[{"kk", ",", "mm"}], "]"}], "]"}], "=", RowBox[{"GCD", "[", RowBox[{ RowBox[{"gcd", "[", RowBox[{"[", RowBox[{"kk", ",", RowBox[{"mm", "-", "1"}]}], "]"}], "]"}], ",", RowBox[{"J", "[", RowBox[{"[", RowBox[{"kk", ",", "mm"}], "]"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"mm", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"kk", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"kk", "=", "1"}], ",", RowBox[{"kk", "\[LessEqual]", RowBox[{"Length", "[", "J", "]"}]}], ",", " ", RowBox[{ RowBox[{ RowBox[{"gcd", "[", RowBox[{"[", RowBox[{"kk", ",", RowBox[{"Length", "[", RowBox[{"J", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"GCD", "[", RowBox[{ RowBox[{"gcd", "[", RowBox[{"[", RowBox[{"kk", ",", RowBox[{"Length", "[", RowBox[{"J", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"kk", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"maxperiod", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Length", "[", "J", "]"}], ",", "10000"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"jj", "=", "1"}], ",", " ", RowBox[{"jj", "\[LessEqual]", RowBox[{"Length", "[", "J", "]"}]}], ",", RowBox[{ RowBox[{"Clear", "[", RowBox[{ "B", ",", "R", ",", "Tile", ",", "A", ",", "U", ",", "mark", ",", "T", ",", "g", ",", "x"}], "]"}], ";", RowBox[{"n", "=", "144"}], ";", RowBox[{"n", "=", RowBox[{"n", "/", RowBox[{"gcd", "[", RowBox[{"[", RowBox[{"jj", ",", " ", RowBox[{"Length", "[", RowBox[{"J", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], "]"}]}]}], ";", RowBox[{"B", "=", RowBox[{ RowBox[{"J", "[", RowBox[{"[", "jj", "]"}], "]"}], "/", RowBox[{"gcd", "[", RowBox[{"[", RowBox[{"jj", ",", RowBox[{"Length", "[", RowBox[{"J", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Tile", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", "100000"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"R", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"A", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}], ",", "n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"U", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"0", "&"}], ",", RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"U", "[", RowBox[{"[", "1", "]"}], "]"}], "=", "B"}], ";", "\[IndentingNewLine]", RowBox[{"mark", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"1", "&"}], ",", RowBox[{ RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}], "+", "1"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"T", "=", RowBox[{"Array", "[", RowBox[{ RowBox[{ RowBox[{"{", "0", "}"}], "&"}], ",", RowBox[{"n", "/", RowBox[{"Length", "[", "B", "]"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"g", "=", "1"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", " ", RowBox[{"i", ">", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Length", "[", RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], "\[Equal]", "n"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"Tile", "[", RowBox[{"[", "g", "]"}], "]"}], "=", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}]}], ";", RowBox[{ RowBox[{"maxperiod", "[", RowBox[{"[", RowBox[{"jj", ",", "g"}], "]"}], "]"}], "=", "99"}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"ff", "=", RowBox[{ RowBox[{"Length", "[", RowBox[{"Divisors", "[", "n", "]"}], "]"}], "-", "1"}]}], ",", " ", RowBox[{"ff", ">", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Divisors", "[", "n", "]"}], "[", RowBox[{"[", "ff", "]"}], "]"}], ")"}], "+", RowBox[{"Tile", "[", RowBox[{"[", "g", "]"}], "]"}]}], ")"}], ",", "n"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}], "==", RowBox[{"Tile", "[", RowBox[{"[", "g", "]"}], "]"}]}], ",", RowBox[{ RowBox[{ RowBox[{"Tile", "[", RowBox[{"[", "g", "]"}], "]"}], "=", "0"}], ";", RowBox[{ RowBox[{"maxperiod", "[", RowBox[{"[", RowBox[{"jj", ",", "g"}], "]"}], "]"}], "=", RowBox[{ RowBox[{"Divisors", "[", "n", "]"}], "[", RowBox[{"[", "ff", "]"}], "]"}]}], ";", RowBox[{"ff", "=", "0"}], ";"}]}], "\[IndentingNewLine]", " ", "]"}], ";", "\[IndentingNewLine]", RowBox[{"ff", "=", RowBox[{"ff", "-", "1"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", " ", RowBox[{"g", "=", RowBox[{"g", "+", "1"}]}], ";", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "-", "1"}], "]"}], "]"}]}], ";", RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", " ", RowBox[{"j", "\[LessEqual]", "n"}], ",", RowBox[{ RowBox[{"k", "=", "100"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{"MemberQ", "[", RowBox[{ RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"Mod", "[", RowBox[{"j", ",", "n"}], "]"}]}], "]"}], "]"}], ",", " ", RowBox[{ RowBox[{"k", "=", "0"}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"m", "=", "1"}], ",", " ", RowBox[{"m", "\[LessEqual]", RowBox[{"Length", "[", "B", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Intersection]", " ", RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"j", "-", RowBox[{"B", "[", RowBox[{"[", "m", "]"}], "]"}]}], ")"}], "+", "B"}], ",", "n"}], "]"}]}], "\[Equal]", RowBox[{"{", "}"}]}], ",", " ", RowBox[{ RowBox[{"k", "=", RowBox[{"k", "+", "1"}]}], ";", " ", RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "m"}], "]"}], "]"}], "=", RowBox[{"Mod", "[", RowBox[{ RowBox[{"j", "-", RowBox[{"B", "[", RowBox[{"[", "m", "]"}], "]"}]}], ",", "n"}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"m", "++"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"R", "[", RowBox[{"[", "j", "]"}], "]"}], "=", "k"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"min", "=", RowBox[{"Min", "[", "R", "]"}]}], ";", " ", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"(", RowBox[{"Not", "[", RowBox[{"min", "\[Equal]", "0"}], "]"}], ")"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"t", "=", RowBox[{"Catch", "[", RowBox[{"Do", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"R", "[", RowBox[{"[", "ii", "]"}], "]"}], "\[Equal]", "min"}], ",", " ", RowBox[{"Throw", "[", "ii", "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"ii", ",", "n"}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "\[LessEqual]", RowBox[{"Length", "[", "B", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"b", "=", RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}]}], ",", " ", RowBox[{"b", "<=", RowBox[{"Length", "[", "B", "]"}]}], ",", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"b", "+", "1"}]}], ";", RowBox[{"z", "=", "0"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "t", ",", "b"}], "]"}], "]"}], "\[Equal]", "200"}], "]"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"U", "[", RowBox[{"[", RowBox[{"i", "+", "1"}], "]"}], "]"}], "=", RowBox[{ RowBox[{"U", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Union]", RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "t", ",", "b"}], "]"}], "]"}], "+", "B"}], ",", "n"}], "]"}]}]}], ";", " ", RowBox[{ RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "+", "1"}], "]"}], "]"}], "=", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "\[Union]", RowBox[{"{", RowBox[{"A", "[", RowBox[{"[", RowBox[{"i", ",", "t", ",", "b"}], "]"}], "]"}], "}"}]}]}], ";", " ", RowBox[{"b", "=", RowBox[{ RowBox[{"Length", "[", "B", "]"}], "+", "1"}]}], ";", RowBox[{"z", "=", "1"}], ";", RowBox[{"i", "=", RowBox[{"i", "+", "1"}]}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"b", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"z", "==", "0"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}]}], "]"}], ";"}], "\[IndentingNewLine]", ",", " ", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "-", "1"}], "]"}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}]}], "]"}], ";"}], "\[IndentingNewLine]", ",", " ", RowBox[{ RowBox[{ RowBox[{"mark", "[", RowBox[{"[", "i", "]"}], "]"}], "=", "1"}], ";", RowBox[{ RowBox[{"A", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"Array", "[", RowBox[{ RowBox[{"200", "&"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"Length", "[", "B", "]"}]}], "}"}]}], "]"}]}], ";", RowBox[{ RowBox[{"T", "[", RowBox[{"[", "i", "]"}], "]"}], "=", RowBox[{"T", "[", RowBox[{"[", RowBox[{"i", "-", "1"}], "]"}], "]"}]}], ";", RowBox[{"i", "=", RowBox[{"i", "-", "1"}]}]}]}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Tile", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Tile", "\[Union]", RowBox[{"{", "0", "}"}]}], ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"Length", "[", "Tile", "]"}], "\[IndentingNewLine]", "Tile"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", " ", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "Tile", "]"}]}], ",", " ", RowBox[{ RowBox[{"P", "=", RowBox[{"Tile", "[", RowBox[{"[", "j", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "2"}], ",", " ", RowBox[{"i", "<=", RowBox[{"Length", "[", "P", "]"}]}], ",", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"Tile", ",", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"P", "-", RowBox[{"P", "[", RowBox[{"[", "i", "]"}], "]"}]}], ",", "n"}], "]"}], "\[Union]", RowBox[{"{", "}"}]}]}], "]"}], ",", " ", RowBox[{ RowBox[{ RowBox[{"Tile", "[", RowBox[{"[", "j", "]"}], "]"}], "=", "0"}], ";", RowBox[{"i", "=", RowBox[{ RowBox[{"Length", "[", "P", "]"}], "+", "1"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"i", "++"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";", " ", "\[IndentingNewLine]", RowBox[{"Tile", "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Tile", "\[Union]", RowBox[{"{", "0", "}"}]}], ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{ RowBox[{"Length", "[", "Tile", "]"}], "\[Equal]", "0"}], "]"}], ",", " ", RowBox[{"rr", "=", RowBox[{"rr", "+", "1"}]}]}], "]"}], ";", "\[IndentingNewLine]", "Tile", ";", "\[IndentingNewLine]", RowBox[{"jj", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "rr", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"j", "=", "1"}], ",", RowBox[{"j", "\[LessEqual]", RowBox[{"Length", "[", "maxperiod", "]"}]}], ",", RowBox[{ RowBox[{ RowBox[{"maxperiod", "[", RowBox[{"[", "j", "]"}], "]"}], "=", RowBox[{"Drop", "[", RowBox[{ RowBox[{ RowBox[{"maxperiod", "[", RowBox[{"[", "j", "]"}], "]"}], "\[Union]", RowBox[{"{", "0", "}"}]}], ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "++"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "maxperiod", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.43365186375*^9, 3.4336518651875*^9}, 3.4336519188125*^9, 3.433652227171875*^9, {3.4336523075*^9, 3.433652326828125*^9}, { 3.433652391015625*^9, 3.4336524006875*^9}, 3.43365255971875*^9, { 3.433652619015625*^9, 3.43365262009375*^9}, 3.433652684859375*^9, 3.433652755703125*^9, 3.4336539463125*^9}], Cell[BoxData[ DynamicBox[ ToBoxes[{$CellContext`jj, $CellContext`j, $CellContext`i, $CellContext`g, \ $CellContext`mark, $CellContext`rr}, StandardForm], ImageSizeCache->{180.5, {2., 8.}}]], "Output", CellChangeTimes->{3.433606160671875*^9, 3.43360623896875*^9, 3.433653968125*^9}], Cell[BoxData["1"], "Output", CellChangeTimes->{3.433606160671875*^9, 3.43360623896875*^9, 3.43365396865625*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", "12", "}"}], ",", RowBox[{"{", "12", "}"}], ",", RowBox[{"{", "12", "}"}], ",", RowBox[{"{", "12", "}"}], ",", RowBox[{"{", "4", "}"}], ",", RowBox[{"{", "4", "}"}]}], "}"}]], "Output", CellChangeTimes->{3.433606160671875*^9, 3.43360623896875*^9, 3.433653968671875*^9}] }, Open ]] }, WindowSize->{1033, 567}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"6.0 for Microsoft Windows (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 1100, 29, 192, "Input"], Cell[1693, 54, 157, 4, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[1887, 63, 15108, 383, 1192, "Input"], Cell[16998, 448, 234, 4, 30, "Output"], Cell[17237, 455, 564, 10, 50, "Output"], Cell[17804, 467, 118, 2, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17959, 474, 3101, 75, 352, "Input"], Cell[21063, 551, 71, 1, 30, "Output"], Cell[21137, 554, 15150, 364, 506, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[36324, 923, 15137, 402, 2112, "Input"], Cell[51464, 1327, 217, 5, 30, "Output"], Cell[51684, 1334, 71, 1, 30, "Output"], Cell[51758, 1337, 70, 1, 30, "Output"], Cell[51831, 1340, 597, 16, 30, "Output"], Cell[52431, 1358, 554, 15, 30, "Output"], Cell[52988, 1375, 1127, 28, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[54152, 1408, 23618, 590, 1592, "Input"], Cell[77773, 2000, 290, 6, 30, "Output"], Cell[78066, 2008, 115, 2, 30, "Output"], Cell[78184, 2012, 349, 10, 30, "Output"] }, Open ]] } ] *) (* End of internal cache information *)