(* 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[ 69769, 2268] NotebookOptionsPosition[ 60433, 1950] NotebookOutlinePosition[ 62285, 2008] CellTagsIndexPosition[ 61863, 1995] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["RegularSequences 1.05", "Title"], Cell["documentation notebook", "Subtitle"], Cell[TextData[{ "Eric Rowland\n", ButtonBox["http://math.tulane.edu/~erowland/packages.html", BaseStyle->"Hyperlink", ButtonData:>{ URL["http://math.tulane.edu/~erowland/packages.html"], None}] }], "Subsubtitle"], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell["\<\ RegularSequences is a package for identifying and analyzing automatic and \ regular sequences. This introduction gives an overview of the main features of the package; the \ next section provides a complete list of package symbols along with their \ usage messages and further examples.\ \>", "Text"], Cell[TextData[{ "To use RegularSequences, first you will need to load the package by \ evaluating the following cell. ", "(If you need help, see ", ButtonBox["loading a package", BaseStyle->"Hyperlink", ButtonData->{ URL["http://math.tulane.edu/~erowland/packages/loadingapackage.html"], None}, ButtonNote-> "http://math.tulane.edu/~erowland/packages/loadingapackage.html"], ".)" }], "Text"], Cell[BoxData[ RowBox[{"<<", "RegularSequences`"}]], "Code"], Cell[CellGroupData[{ Cell["Automatic and regular sequences", "Subsection"], Cell[TextData[{ "A sequence ", Cell[BoxData[ FormBox[ RowBox[{"a", "(", "n", ")"}], TraditionalForm]]], " is ", Cell[BoxData[ FormBox["k", TraditionalForm]]], "-automatic if there is a finite automaton that outputs ", Cell[BoxData[ FormBox[ RowBox[{"a", "(", "n", ")"}], TraditionalForm]]], " when fed the base-", Cell[BoxData[ FormBox["k", TraditionalForm]]], " digits of ", Cell[BoxData[ FormBox["n", TraditionalForm]]], ". Regular sequences are a natural generalization of automatic sequences. \ They were introduced by Allouche and Shallit in the paper \"The ring of ", Cell[BoxData[ FormBox["k", TraditionalForm]], FontSlant->"Plain"], "-regular sequences\" (", StyleBox["Theoretical Computer Science", FontSlant->"Italic"], " ", StyleBox["98", FontWeight->"Bold"], " (1992) 163\[Dash]197); the paper can be found ", ButtonBox["here", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.cs.uwaterloo.ca/~shallit/Papers/as0.ps"], None}, ButtonNote->"http://www.cs.uwaterloo.ca/~shallit/Papers/as0.ps"], "." }], "Text"], Cell[TextData[{ "Let ", Cell[BoxData[ FormBox[ RowBox[{"a", "(", "n", ")"}], TraditionalForm]], FormatType->"TraditionalForm"], " be the parity of the number of 1s in the binary representation of ", Cell[BoxData[ FormBox["n", TraditionalForm]], FormatType->"TraditionalForm"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Table", "[", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{"n", ",", "2", ",", "1"}], "]"}], ",", "2"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "31"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1"}], "}"}]], "Output"] }, Open ]], Cell[TextData[{ "That sequence is 2-automatic. Therefore it is also 2-regular, and ", StyleBox["FindRegularSequenceFunction", "Input"], " gives a representation for this sequence." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{"%", ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[TextData[{ StyleBox["FindRegularSequenceFunction", "Input"], " returns a ", StyleBox["RegularSequence", "Input"], " object, which behaves as a function like ", StyleBox["DifferenceRoot", "Input"], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"%", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1"}], "}"}]], "Output"] }, Open ]], Cell[TextData[{ "If we consider instead the total number of 1s in the binary representation \ of ", Cell[BoxData[ FormBox["n", TraditionalForm]]], ", this sequence does not take finitely many values, so it is not automatic." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Table", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{"n", ",", "2", ",", "1"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "31"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "2", ",", "1", ",", "2", ",", "2", ",", "3", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "2", ",", "3", ",", "3", ",", "4", ",", "3", ",", "4", ",", "4", ",", "5"}], "}"}]], "Output"] }, Open ]], Cell["However, it is 2-regular:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{"%", ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"%", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "2", ",", "1", ",", "2", ",", "2", ",", "3", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "2", ",", "3", ",", "3", ",", "4", ",", "3", ",", "4", ",", "4", ",", "5"}], "}"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Studying a regular sequence", "Subsection"], Cell["\<\ The Thue\[Dash]Morse sequence is a famous example of a 2-automatic sequence. \ It is an infinite sequence of 0s and 1s with the property that no block of \ entries ever occurs three times in a row.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ThueMorse", "/@", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1"}], "}"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"tm", "=", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{"%", ",", "2"}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"tm", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1"}], "}"}]], "Output"] }, Open ]], Cell[TextData[{ "The Thue\[Dash]Morse sequence ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "1"], "(", "n", ")"}], TraditionalForm]]], " satisfies the following system of linear recurrences." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceRecurrence", "[", RowBox[{"tm", ",", "t", ",", "n"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SubscriptBox["t", "1"], "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["t", "1"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["t", "1"], "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["t", "2"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["t", "1"], "[", "0", "]"}], "\[Equal]", "0"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SubscriptBox["t", "2"], "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["t", "2"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["t", "2"], "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["t", "1"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["t", "2"], "[", "0", "]"}], "\[Equal]", "1"}]}], "}"}]}], "}"}]], "Output"] }, Open ]], Cell[TextData[{ "The two sequences ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "1"], "(", "n", ")"}], TraditionalForm]]], " and ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["t", "2"], "(", "n", ")"}], TraditionalForm]]], " from that system are subsequences of the Thue\[Dash]Morse sequence:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceRecurrence", "[", RowBox[{ RowBox[{"ThueMorse", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "]"}], ",", "2", ",", RowBox[{"t", "[", "n", "]"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"t", "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{"t", "[", "n", "]"}]}], ",", "True", ",", RowBox[{ RowBox[{"t", "[", "0", "]"}], "\[Equal]", "0"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"t", "[", RowBox[{"1", "+", RowBox[{"4", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{"t", "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}]}], ",", RowBox[{ RowBox[{"t", "[", RowBox[{"1", "+", RowBox[{"2", " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], ")"}]}]}], "]"}], "\[Equal]", RowBox[{"t", "[", "n", "]"}]}], ",", RowBox[{ RowBox[{"t", "[", "1", "]"}], "\[Equal]", "1"}]}], "}"}]}], "}"}]], "Output"] }, Open ]], Cell["Here are the first few terms:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceGeneratorTable", "[", RowBox[{"tm", ",", "15"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1"}], "}"}]}], "}"}]], "Output"] }, Open ]], Cell["\<\ The partial sums of the Thue\[Dash]Morse sequence grow linearly:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceExponent", "[", "tm", "]"}]], "Input"], Cell[BoxData["1"], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ListPlot", "[", RowBox[{"Accumulate", "@", RowBox[{"tm", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "200"}], "]"}], "]"}]}], "]"}]], "Input"], Cell[BoxData[ GraphicsBox[ {Hue[0.67, 0.6, 0.6], PointBox[CompressedData[" 1:eJxd1UluFEEQheEQK5YsWLBgkSCEEEKIeQYHZp7BzKMLgxlWXCGOUkfJLbeo I3AEjPhfS/laskJfp9VVlRnx6sDWr43tXRHxe+fvX/3/+bMW4yfH73fn+P0e 894c/2+feb+52e8ctN85ZD5sPmLXOWo+Ztc9btc9YT5p93HKfNp8xu7zrPmc 3fd5u+8L5ovmS1Q912WqnuuK+SpVz3nNvGZOKvtQsvbh+ugyxzqVfSpz3KCy byVr326OLnPcorKvJWtfb48uWft8Z3SZ4y6Vcyhz3KNyLiXrXO6PLlnn9GB0 meMhlXMsWef4aHSZ4zGVcy5zPKFy7iXrnJ+OTqw+KHM3xzMqfZHmwuqbrvV1 6sboNBdWX3Wtq4+ej06sPitzN8cLKn2X5sLqy6519eHL0YnVp2Xu5nhFpW8T q4/L3M3xmkpfp7mw+r5rXX3+ZnSaC2suutY1B29HJ9aclLmb4x2VuUmsOSpz N8d7KnOV5sKau651zdmH0Yk1h2Xu5vhIZS7TXFhz27WuOf00Os2FNddd65rj zdGJNedl7uaYqMx1w8qBNE/mwsqJ2dyxcmPR9ZQDn0c3c2LlyoRXuWKesXKm mxdzbFHJlWZOrFya8CqXzDNWTnXzYo4vVHKpYeVYmidzYeXcbO5Yubfoesqx r6ObObFyccKrXDTPWDnZzYs5tqnkYsPK0TRP5sLK2dncsXJ30fWUu99GN6wc TvNkLqycns0dK7cXXU85/H10MydWrk94levmGSvnu3kxxw8qud7MifVemPDq vWCesd4T3byY4yeV90LDO++RvyLWSVQ= "]]}, AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948], Axes->True, AxesOrigin->{0, Automatic}, PlotRange->Automatic, PlotRangeClipping->True]], "Output"] }, Open ]], Cell[BoxData[ RowBox[{"Clear", "[", "tm", "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Other examples of regular sequences", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"Accumulate", "[", RowBox[{"ThueMorse", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "]"}], "]"}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0"}, {"0", "0", "0", "1"}, {"0", RowBox[{"-", "1"}], "1", "1"}, {"0", RowBox[{"-", "2"}], "0", "3"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "1", "0"}, {"0", RowBox[{"-", "2"}], "2", "1"}, {"0", "0", "2", "0"}, {"0", RowBox[{"-", "3"}], "3", "2"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"IntegerExponent", "[", RowBox[{ RowBox[{"Range", "[", "64", "]"}], ",", "2"}], "]"}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0"}, { RowBox[{"-", "1"}], "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1"}, { RowBox[{"-", "1"}], "2"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"IntegerExponent", "[", RowBox[{ RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "!"}], ",", "2"}], "]"}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0"}, { RowBox[{"-", "2"}], "3", "0"}, { RowBox[{"-", "4"}], "4", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0"}, {"0", "0", "1"}, {"2", RowBox[{"-", "5"}], "4"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"IntegerExponent", "[", RowBox[{ RowBox[{"Fibonacci", "[", RowBox[{"Range", "[", SuperscriptBox["2", "7"], "]"}], "]"}], ",", "2"}], "]"}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0", "0"}, {"0", "0", "0", "1", "0"}, {"0", "3", "0", "0", "0"}, {"0", "1", "0", "0", "0"}, {"0", "0", "0", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "1", "0", "0"}, {"0", "0", "0", "0", "1"}, {"0", "0", "1", "1", "0"}, {"0", "0", "0", "1", "0"}, {"0", "1", "0", "0", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"IntegerExponent", "[", RowBox[{ RowBox[{"Fibonacci", "[", RowBox[{"Range", "[", "1000", "]"}], "]"}], ",", "4"}], "]"}], ",", "4"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0"}, {"0", "0", "0", "1", "0"}, {"0", "0", "0", "1", "0"}, {"0", "0", "0", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0", "0"}, {"0", "0", "0", "0", "1"}, {"0", "2", "0", "0", "0"}, {"0", "2", "0", "0", "0"}, {"0", "0", "0", FractionBox["1", "2"], "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "0", "0"}, {"0", "0", "0", FractionBox["1", "2"], "0"}, {"0", "0", "0", "0", "2"}, {"0", "0", "0", "0", "2"}, {"0", "1", "0", "0", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "1", "0", "0"}, {"0", "1", "0", "0", "0"}, {"0", "0", "1", FractionBox["1", "2"], "0"}, {"0", "0", "0", "1", "0"}, {"0", "0", "0", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"Accumulate", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"Boole", "[", RowBox[{ RowBox[{"Length", "[", RowBox[{"PowersRepresentations", "[", RowBox[{"n", ",", "3", ",", "2"}], "]"}], "]"}], ">", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", SuperscriptBox["2", "6"]}], "}"}]}], "]"}], "]"}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0", "0", "0"}, {"0", "0", "0", "1", "0", "0"}, {"0", "0", "0", "0", "1", "0"}, { RowBox[{"-", "2"}], "1", "0", "4", RowBox[{"-", "3"}], "1"}, { RowBox[{"-", "2"}], "1", "0", "3", RowBox[{"-", "2"}], "1"}, { RowBox[{"-", "2"}], "1", "0", "1", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "1", "0", "0", "0"}, {"0", "0", "0", RowBox[{"-", "1"}], "2", "0"}, {"0", "0", "0", "0", "0", "1"}, { RowBox[{"-", "2"}], "0", "1", "1", "0", "1"}, { RowBox[{"-", "2"}], "0", "1", "0", "1", "1"}, { RowBox[{"-", "2"}], "0", "1", RowBox[{"-", "1"}], "2", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "2", ",", "1", ",", "2", ",", "4"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[TextData[{ "Counting the number of nonzero entries in the ", Cell[BoxData[ FormBox["n", TraditionalForm]]], "th row of an additive cellular automaton produces a regular sequence:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"Total", "/@", RowBox[{"CellularAutomaton", "[", RowBox[{ RowBox[{"{", RowBox[{"27030", ",", "2", ",", FractionBox["3", "2"]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", "1", "}"}], ",", "0"}], "}"}], ",", RowBox[{ SuperscriptBox["2", "5"], "-", "1"}]}], "]"}]}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0"}, {"4", "0", "0"}, {"0", "1", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0"}, {"0", "0", "1"}, {"0", "0", "2"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "4"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"Total", "/@", RowBox[{"CellularAutomaton", "[", RowBox[{ RowBox[{"{", RowBox[{"39270", ",", "2", ",", FractionBox["3", "2"]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", "1", "}"}], ",", "0"}], "}"}], ",", RowBox[{ SuperscriptBox["2", "6"], "-", "1"}]}], "]"}]}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0"}, {"3", "0", "0", "0"}, {"4", "1", "0", "0"}, {"7", "2", "0", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0"}, {"0", "0", "1", "0"}, {"0", "0", "0", "1"}, { RowBox[{"-", "2"}], "1", "0", "2"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "7", ",", "13"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"CellularAutomaton", "[", RowBox[{"90", ",", RowBox[{"{", RowBox[{ RowBox[{"{", "1", "}"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ SuperscriptBox["2", "5"], "-", "1"}], ",", RowBox[{"{", RowBox[{"{", "3", "}"}], "}"}]}], "}"}]}], "]"}], ",", "2"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "0"}, {"0", "0", "1", "0"}, {"0", "0", "0", "0"}, {"0", "0", RowBox[{"-", "1"}], "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0"}, {"0", "0", "0", "1"}, {"0", "0", "0", "1"}, {"0", "0", "0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["Package symbols", "Section"], Cell[CellGroupData[{ Cell[TextData[StyleBox["FindRegularSequenceFunction", "Input"]], \ "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "FindRegularSequenceFunction"}]], "Input"], Cell[BoxData[ StyleBox["\<\"FindRegularSequenceFunction[{\!\(\*SubscriptBox[StyleBox[\\\"a\ \\\", \\\"TI\\\"], StyleBox[\\\"0\\\", \\\"TR\\\"]]\), \ \!\(\*SubscriptBox[StyleBox[\\\"a\\\", \\\"TI\\\"], StyleBox[\\\"1\\\", \ \\\"TR\\\"]]\), \*StyleBox[\\\"\[Ellipsis]\\\", \\\"TI\\\"]}, \ \*StyleBox[\\\"k\\\", \\\"TI\\\"]] attempts to find a simple RegularSequence \ function that yields the sequence \!\(\*SubscriptBox[StyleBox[\\\"a\\\", \ \\\"TI\\\"], StyleBox[\\\"n\\\", \\\"TI\\\"]]\) when given successive integer \ arguments.\\nFindRegularSequenceFunction[\*StyleBox[\\\"list\\\", \ \\\"TI\\\"], \*StyleBox[\\\"k\\\", \\\"TI\\\"], \*StyleBox[\\\"n\\\", \ \\\"TI\\\"]] gives the function applied to \*StyleBox[\\\"n\\\", \\\"TI\\\"].\ \"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088158-6717758"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{"n", ",", "2", ",", "1"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "31"}], "}"}]}], "]"}], ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["FindRegularSequenceRecurrence", "Input"]], \ "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", StyleBox["FindRegularSequenceRecurrence", "Input"]}]], "Input"], Cell[BoxData[ StyleBox["\<\"FindRegularSequenceRecurrence[{\!\(\*SubscriptBox[StyleBox[\\\"\ a\\\", \\\"TI\\\"], StyleBox[\\\"0\\\", \\\"TR\\\"]]\), \ \!\(\*SubscriptBox[StyleBox[\\\"a\\\", \\\"TI\\\"], StyleBox[\\\"1\\\", \ \\\"TR\\\"]]\), \*StyleBox[\\\"\[Ellipsis]\\\", \\\"TI\\\"]}, \ \*StyleBox[\\\"k\\\", \\\"TI\\\"], \*StyleBox[\\\"a\\\", \ \\\"TI\\\"][\*StyleBox[\\\"n\\\", \\\"TI\\\"]]] attempts to find linear \ relations between subsequences of \*StyleBox[\\\"a\\\", \ \\\"TI\\\"][\*StyleBox[\\\"n\\\", \\\"TI\\\"]] of the form \*StyleBox[\\\"a\\\ \", \\\"TI\\\"][\*StyleBox[\\\"k\\\", \\\"TI\\\"]^\*StyleBox[\\\"e\\\", \ \\\"TI\\\"] \*StyleBox[\\\"n\\\", \\\"TI\\\"] + \*StyleBox[\\\"i\\\", \ \\\"TI\\\"]].\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088161-5739138"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox["FindRegularSequenceRecurrence", "Input"], "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{"n", ",", "2", ",", "1"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "0", ",", "31"}], "}"}]}], "]"}], ",", "2", ",", RowBox[{"a", "[", "n", "]"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{"a", "[", "n", "]"}]}], ",", "True", ",", RowBox[{ RowBox[{"a", "[", "0", "]"}], "\[Equal]", "0"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"4", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}]}], ",", RowBox[{ RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"2", " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], ")"}]}]}], "]"}], "\[Equal]", RowBox[{ RowBox[{"-", RowBox[{"a", "[", "n", "]"}]}], "+", RowBox[{"2", " ", RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}]}]}]}], ",", RowBox[{ RowBox[{"a", "[", "1", "]"}], "\[Equal]", "1"}]}], "}"}]}], "}"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["RegularSequence", "Input"]], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RegularSequence"}]], "Input"], Cell[BoxData[ StyleBox["\<\"RegularSequence[\*StyleBox[\\\"\[Lambda]\\\", \\\"TI\\\"], {\!\ \(\*SubscriptBox[StyleBox[\\\"m\\\", \\\"TI\\\"], StyleBox[\\\"0\\\", \ \\\"TR\\\"]]\), \!\(\*SubscriptBox[StyleBox[\\\"m\\\", \\\"TI\\\"], StyleBox[\ \\\"1\\\", \\\"TR\\\"]]\), \*StyleBox[\\\"\[Ellipsis]\\\", \\\"TI\\\"], \ \!\(\*SubscriptBox[StyleBox[\\\"m\\\", \\\"TI\\\"], StyleBox[\\\"k-1\\\", \ \\\"TI\\\"]]\)}, \*StyleBox[\\\"\[Kappa]\\\", \\\"TI\\\"]][\*StyleBox[\\\"n\\\ \", \\\"TI\\\"]] gives \*StyleBox[\\\"\[Lambda]\\\", \ \\\"TI\\\"].\!\(\*SubscriptBox[StyleBox[\\\"m\\\", \\\"TI\\\"], \ StyleBox[\\\"n0\\\", \\\"TI\\\"]]\).\!\(\*SubscriptBox[StyleBox[\\\"m\\\", \\\ \"TI\\\"], StyleBox[\\\"n1\\\", \ \\\"TI\\\"]]\).\[CenterEllipsis].\!\(\*SubscriptBox[StyleBox[\\\"m\\\", \ \\\"TI\\\"], StyleBox[\\\"nl\\\", \\\"TI\\\"]]\).\*StyleBox[\\\"\[Kappa]\\\", \ \\\"TI\\\"], where \*StyleBox[\\\"n\\\", \\\"TI\\\"] \[Equal] \ \!\(\*SubscriptBox[StyleBox[\\\"n\\\", \\\"TI\\\"], StyleBox[\\\"l\\\", \ \\\"TI\\\"]]\)\[CenterEllipsis]\!\(\*SubscriptBox[StyleBox[\\\"n\\\", \ \\\"TI\\\"], StyleBox[\\\"1\\\", \\\"TR\\\"]]\)\!\(\*SubscriptBox[StyleBox[\\\ \"n\\\", \\\"TI\\\"], StyleBox[\\\"0\\\", \\\"TR\\\"]]\) in base \ \*StyleBox[\\\"k\\\", \\\"TI\\\"].\\nRegularSequence[\*StyleBox[\\\"\[Lambda]\ \\\", \\\"TI\\\"], \*StyleBox[\\\"matrices\\\", \\\"TI\\\"], \*StyleBox[\\\"\ \[Kappa]\\\", \\\"TI\\\"]][{\!\(\*SubscriptBox[StyleBox[\\\"n\\\", \ \\\"TI\\\"], StyleBox[\\\"1\\\", \\\"TR\\\"]]\), \!\(\*SubscriptBox[StyleBox[\ \\\"n\\\", \\\"TI\\\"], StyleBox[\\\"2\\\", \\\"TR\\\"]]\), \*StyleBox[\\\"\ \[Ellipsis]\\\", \\\"TI\\\"]}] gives terms \ \!\(\*SubscriptBox[StyleBox[\\\"n\\\", \\\"TI\\\"], StyleBox[\\\"1\\\", \ \\\"TR\\\"]]\), \!\(\*SubscriptBox[StyleBox[\\\"n\\\", \\\"TI\\\"], StyleBox[\ \\\"2\\\", \\\"TR\\\"]]\), \*StyleBox[\\\"\[Ellipsis]\\\", \\\"TI\\\"] of a \ \*StyleBox[\\\"k\\\", \\\"TI\\\"]\[Hyphen]regular sequence.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088163-1787245"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}], "/@", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}]}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "2", ",", "1", ",", "2", ",", "2", ",", "3", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "2", ",", "3", ",", "3", ",", "4", ",", "3", ",", "4", ",", "4", ",", "5"}], "}"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["RegularSequenceExponent", "Input"]], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RegularSequenceExponent"}]], "Input"], Cell[BoxData[ StyleBox["\<\"RegularSequenceExponent[RegularSequence[\*StyleBox[\\\"\ \[Lambda]\\\", \\\"TI\\\"], \*StyleBox[\\\"matrices\\\", \\\"TI\\\"], \ \*StyleBox[\\\"\[Kappa]\\\", \\\"TI\\\"]]] gives the exponent in the \ asymptotic growth rate of the partial sums of a \*StyleBox[\\\"k\\\", \ \\\"TI\\\"]\[Hyphen]regular sequence.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088166-3369570"] }, Open ]], Cell["Compute the fractal dimension of the Sierpinski sieve:", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"Total", "/@", RowBox[{"CellularAutomaton", "[", RowBox[{"90", ",", RowBox[{"{", RowBox[{ RowBox[{"{", "1", "}"}], ",", "0"}], "}"}], ",", "100"}], "]"}]}], ",", "2"}], "]"}], "\[IndentingNewLine]", RowBox[{"RegularSequenceExponent", "[", "%", "]"}]}], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", "1", "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"{", "1", "}"}], "}"}], ",", RowBox[{"{", RowBox[{"{", "2", "}"}], "}"}]}], "}"}], ",", RowBox[{"{", "1", "}"}]}], "]"}]], "Output"], Cell[BoxData[ FractionBox[ RowBox[{"Log", "[", "3", "]"}], RowBox[{"Log", "[", "2", "]"}]]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["RegularSequenceGeneratorTable", "Input"]], \ "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RegularSequenceGeneratorTable"}]], "Input"], Cell[BoxData[ StyleBox["\<\"RegularSequenceGeneratorTable[RegularSequence[\*StyleBox[\\\"\ \[Lambda]\\\", \\\"TI\\\"], \*StyleBox[\\\"matrices\\\", \\\"TI\\\"], \ \*StyleBox[\\\"\[Kappa]\\\", \\\"TI\\\"]], \*StyleBox[\\\"n\\\", \\\"TI\\\"]] \ gives terms 0 through \*StyleBox[\\\"n\\\", \\\"TI\\\"] of the generators of \ the additive group generated by the \*StyleBox[\\\"k\\\", \ \\\"TI\\\"]\[Hyphen]kernel of a \*StyleBox[\\\"k\\\", \ \\\"TI\\\"]\[Hyphen]regular sequence, where the first generator is the \ sequence itself.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088168-3713130"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], ",", "2", ",", "1"}], "]"}], ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox["RegularSequenceGeneratorTable", "Input"], "[", RowBox[{"%", ",", "31"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "2", ",", "1", ",", "2", ",", "2", ",", "3", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "2", ",", "3", ",", "3", ",", "4", ",", "3", ",", "4", ",", "4", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "2", ",", "3", ",", "2", ",", "3", ",", "3", ",", "4", ",", "2", ",", "3", ",", "3", ",", "4", ",", "3", ",", "4", ",", "4", ",", "5", ",", "2", ",", "3", ",", "3", ",", "4", ",", "3", ",", "4", ",", "4", ",", "5", ",", "3", ",", "4", ",", "4", ",", "5", ",", "4", ",", "5", ",", "5", ",", "6"}], "}"}]}], "}"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["RegularSequenceMatrixForm", "Input"]], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RegularSequenceMatrixForm"}]], "Input"], Cell[BoxData[ StyleBox["\<\"RegularSequenceMatrixForm[RegularSequence[\*StyleBox[\\\"\ \[Lambda]\\\", \\\"TI\\\"], \*StyleBox[\\\"matrices\\\", \\\"TI\\\"], \ \*StyleBox[\\\"\[Kappa]\\\", \\\"TI\\\"]]] displays \*StyleBox[\\\"matrices\\\ \", \\\"TI\\\"] in MatrixForm.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088171-5140446"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], ",", "2", ",", "1"}], "]"}], ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceMatrixForm", "[", "%", "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0"}, {"0", "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ",", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1"}, { RowBox[{"-", "1"}], "2"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["RegularSequenceRank", "Input"]], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RegularSequenceRank"}]], "Input"], Cell[BoxData[ StyleBox["\<\"RegularSequenceRank[RegularSequence[\*StyleBox[\\\"\[Lambda]\\\ \", \\\"TI\\\"], \*StyleBox[\\\"matrices\\\", \\\"TI\\\"], \*StyleBox[\\\"\ \[Kappa]\\\", \\\"TI\\\"]]] gives the size of the vectors and matrices.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088175-3638881"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], ",", "2", ",", "1"}], "]"}], ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceRank", "[", "%", "]"}]], "Input"], Cell[BoxData["2"], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["RegularSequenceRecurrence", "Input"]], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RegularSequenceRecurrence"}]], "Input"], Cell[BoxData[ StyleBox["\<\"RegularSequenceRecurrence[RegularSequence[\*StyleBox[\\\"\ \[Lambda]\\\", \\\"TI\\\"], \*StyleBox[\\\"matrices\\\", \\\"TI\\\"], \ \*StyleBox[\\\"\[Kappa]\\\", \\\"TI\\\"]], \*StyleBox[\\\"a\\\", \\\"TI\\\"], \ \*StyleBox[\\\"n\\\", \\\"TI\\\"]] gives the recurrence relations satisfied \ by generators \!\(\*SubscriptBox[StyleBox[\\\"a\\\", \\\"TI\\\"], StyleBox[\\\ \"i\\\", \\\"TI\\\"]]\)[\*StyleBox[\\\"n\\\", \\\"TI\\\"]] of the additive \ group generated by the \*StyleBox[\\\"k\\\", \\\"TI\\\"]\[Hyphen]kernel of a \ \*StyleBox[\\\"k\\\", \\\"TI\\\"]\[Hyphen]regular sequence, where \ \!\(\*SubscriptBox[StyleBox[\\\"a\\\", \\\"TI\\\"], StyleBox[\\\"1\\\", \ \\\"TR\\\"]]\)[\*StyleBox[\\\"n\\\", \\\"TI\\\"]] is the sequence \ itself.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088178-6728371"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceFunction", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], ",", "2", ",", "1"}], "]"}], ",", "2"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"RegularSequence", "[", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "]"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"RegularSequenceRecurrence", "[", RowBox[{"%", ",", "a", ",", "n"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SubscriptBox["a", "1"], "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["a", "1"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["a", "1"], "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["a", "2"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["a", "1"], "[", "0", "]"}], "\[Equal]", "0"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SubscriptBox["a", "2"], "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{ SubscriptBox["a", "2"], "[", "n", "]"}]}], ",", RowBox[{ RowBox[{ SubscriptBox["a", "2"], "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{ RowBox[{"-", RowBox[{ SubscriptBox["a", "1"], "[", "n", "]"}]}], "+", RowBox[{"2", " ", RowBox[{ SubscriptBox["a", "2"], "[", "n", "]"}]}]}]}], ",", RowBox[{ RowBox[{ SubscriptBox["a", "2"], "[", "0", "]"}], "\[Equal]", "1"}]}], "}"}]}], "}"}]], "Output"] }, Open ]], Cell[TextData[{ StyleBox["FindRegularSequenceRecurrence", "Input"], " gives the relations in terms of subsequences of the original rather than \ as generators of the ", Cell[BoxData[ FormBox["k", TraditionalForm]]], "-kernel:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"FindRegularSequenceRecurrence", "[", RowBox[{ RowBox[{"DigitCount", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], ",", "2", ",", "1"}], "]"}], ",", "2", ",", RowBox[{"a", "[", "n", "]"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "[", RowBox[{"2", " ", "n"}], "]"}], "\[Equal]", RowBox[{"a", "[", "n", "]"}]}], ",", "True", ",", RowBox[{ RowBox[{"a", "[", "0", "]"}], "\[Equal]", "0"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"4", " ", "n"}]}], "]"}], "\[Equal]", RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}]}], ",", RowBox[{ RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"2", " ", RowBox[{"(", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], ")"}]}]}], "]"}], "\[Equal]", RowBox[{ RowBox[{"-", RowBox[{"a", "[", "n", "]"}]}], "+", RowBox[{"2", " ", RowBox[{"a", "[", RowBox[{"1", "+", RowBox[{"2", " ", "n"}]}], "]"}]}]}]}], ",", RowBox[{ RowBox[{"a", "[", "1", "]"}], "\[Equal]", "1"}]}], "}"}]}], "}"}]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["ThueMorse", "Input"]], "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "ThueMorse"}]], "Input"], Cell[BoxData[ StyleBox["\<\"ThueMorse[\*StyleBox[\\\"n\\\", \\\"TI\\\"]] gives the \ \*StyleBox[\\\"n\\\", \\\"TI\\\"]th term in the Thue-Morse sequence.\"\>", "MSG"]], "Print", "PrintUsage", CellTags->"Info3480088183-7386208"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"ThueMorse", "[", RowBox[{"Range", "[", RowBox[{"0", ",", "31"}], "]"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "1", ",", "0", ",", "0", ",", "1"}], "}"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"Reverse", "[", "%", "]"}], "\[Equal]", RowBox[{"1", "-", "%"}]}]], "Input"], Cell[BoxData["True"], "Output"] }, Open ]] }, Closed]] }, Open ]] }, Open ]] }, AutoGeneratedPackage->None, WindowSize->{1272, 717}, WindowMargins->{{Automatic, 0}, {Automatic, 0}}, ShowSelection->True, CellLabelAutoDelete->True, TrackCellChangeTimes->False, Magnification->1., FrontEndVersion->"7.0 for Microsoft Windows (64-bit) (February 18, 2009)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "Info3480088158-6717758"->{ Cell[37555, 1215, 816, 12, 59, "Print", CellTags->"Info3480088158-6717758"]}, "Info3480088161-5739138"->{ Cell[39580, 1279, 794, 12, 42, "Print", CellTags->"Info3480088161-5739138"]}, "Info3480088163-1787245"->{ Cell[42068, 1357, 2012, 29, 60, "Print", CellTags->"Info3480088163-1787245"]}, "Info3480088166-3369570"->{ Cell[45440, 1437, 413, 6, 40, "Print", CellTags->"Info3480088166-3369570"]}, "Info3480088168-3713130"->{ Cell[47000, 1491, 603, 9, 58, "Print", CellTags->"Info3480088168-3713130"]}, "Info3480088171-5140446"->{ Cell[49715, 1574, 344, 5, 40, "Print", CellTags->"Info3480088171-5140446"]}, "Info3480088175-3638881"->{ Cell[52805, 1678, 318, 5, 40, "Print", CellTags->"Info3480088175-3638881"]}, "Info3480088178-6728371"->{ Cell[54378, 1739, 845, 12, 59, "Print", CellTags->"Info3480088178-6728371"]}, "Info3480088183-7386208"->{ Cell[59414, 1913, 232, 4, 40, "Print", CellTags->"Info3480088183-7386208"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3480088158-6717758", 60865, 1965}, {"Info3480088161-5739138", 60977, 1968}, {"Info3480088163-1787245", 61089, 1971}, {"Info3480088166-3369570", 61202, 1974}, {"Info3480088168-3713130", 61313, 1977}, {"Info3480088171-5140446", 61424, 1980}, {"Info3480088175-3638881", 61535, 1983}, {"Info3480088178-6728371", 61646, 1986}, {"Info3480088183-7386208", 61758, 1989} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[567, 22, 38, 0, 83, "Title"], Cell[608, 24, 42, 0, 49, "Subtitle"], Cell[653, 26, 222, 6, 47, "Subsubtitle"], Cell[CellGroupData[{ Cell[900, 36, 31, 0, 71, "Section"], Cell[934, 38, 310, 6, 47, "Text"], Cell[1247, 46, 414, 12, 29, "Text"], Cell[1664, 60, 60, 1, 47, "Code"], Cell[CellGroupData[{ Cell[1749, 65, 53, 0, 36, "Subsection"], Cell[1805, 67, 1079, 36, 47, "Text"], Cell[2887, 105, 308, 11, 29, "Text"], Cell[CellGroupData[{ Cell[3220, 120, 274, 8, 31, "Input"], Cell[3497, 130, 392, 7, 30, "Output"] }, Open ]], Cell[3904, 140, 196, 4, 30, "Text"], Cell[CellGroupData[{ Cell[4125, 148, 103, 2, 31, "Input"], Cell[4231, 152, 583, 20, 30, "Output"] }, Open ]], Cell[4829, 175, 223, 7, 30, "Text"], Cell[CellGroupData[{ Cell[5077, 186, 111, 3, 31, "Input"], Cell[5191, 191, 392, 7, 30, "Output"] }, Open ]], Cell[5598, 201, 241, 6, 29, "Text"], Cell[CellGroupData[{ Cell[5864, 211, 214, 6, 31, "Input"], Cell[6081, 219, 392, 7, 30, "Output"] }, Open ]], Cell[6488, 229, 41, 0, 29, "Text"], Cell[CellGroupData[{ Cell[6554, 233, 103, 2, 31, "Input"], Cell[6660, 237, 608, 21, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7305, 263, 111, 3, 31, "Input"], Cell[7419, 268, 392, 7, 30, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[7860, 281, 49, 0, 28, "Subsection"], Cell[7912, 283, 222, 4, 29, "Text"], Cell[CellGroupData[{ Cell[8159, 291, 115, 3, 31, "Input"], Cell[8277, 296, 392, 7, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8706, 308, 128, 3, 31, "Input"], Cell[8837, 313, 583, 20, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9457, 338, 112, 3, 31, "Input"], Cell[9572, 343, 392, 7, 30, "Output"] }, Open ]], Cell[9979, 353, 223, 7, 29, "Text"], Cell[CellGroupData[{ Cell[10227, 364, 112, 2, 31, "Input"], Cell[10342, 368, 1156, 40, 30, "Output"] }, Open ]], Cell[11513, 411, 338, 12, 29, "Text"], Cell[CellGroupData[{ Cell[11876, 427, 242, 6, 31, "Input"], Cell[12121, 435, 910, 30, 30, "Output"] }, Open ]], Cell[13046, 468, 45, 0, 29, "Text"], Cell[CellGroupData[{ Cell[13116, 472, 107, 2, 31, "Input"], Cell[13226, 476, 485, 12, 30, "Output"] }, Open ]], Cell[13726, 491, 88, 2, 29, "Text"], Cell[CellGroupData[{ Cell[13839, 497, 77, 1, 31, "Input"], Cell[13919, 500, 28, 0, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[13984, 505, 185, 5, 31, "Input"], Cell[14172, 512, 1083, 22, 239, "Output"] }, Open ]], Cell[15270, 537, 59, 1, 31, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15366, 543, 57, 0, 28, "Subsection"], Cell[CellGroupData[{ Cell[15448, 547, 302, 8, 31, "Input"], Cell[15753, 557, 1807, 50, 72, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17597, 612, 266, 7, 31, "Input"], Cell[17866, 621, 1551, 44, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19454, 670, 319, 9, 31, "Input"], Cell[19776, 681, 1669, 47, 57, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21482, 733, 337, 9, 33, "Input"], Cell[21822, 744, 1838, 49, 87, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[23697, 798, 311, 8, 31, "Input"], Cell[24011, 808, 3471, 92, 97, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27519, 905, 570, 16, 33, "Input"], Cell[28092, 923, 2254, 62, 102, "Output"] }, Open ]], Cell[30361, 988, 201, 5, 29, "Text"], Cell[CellGroupData[{ Cell[30587, 997, 517, 15, 47, "Input"], Cell[31107, 1014, 1591, 44, 57, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[32735, 1063, 517, 15, 47, "Input"], Cell[33255, 1080, 1730, 47, 72, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[35022, 1132, 500, 15, 33, "Input"], Cell[35525, 1149, 1729, 47, 72, "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[37315, 1203, 34, 0, 71, "Section"], Cell[CellGroupData[{ Cell[37374, 1207, 83, 1, 28, "Subsubsection"], Cell[CellGroupData[{ Cell[37482, 1212, 70, 1, 31, "Input"], Cell[37555, 1215, 816, 12, 59, "Print", CellTags->"Info3480088158-6717758"] }, Open ]], Cell[CellGroupData[{ Cell[38408, 1232, 305, 9, 31, "Input"], Cell[38716, 1243, 608, 21, 30, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[39373, 1270, 85, 1, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[39483, 1275, 94, 2, 31, "Input"], Cell[39580, 1279, 794, 12, 42, "Print", CellTags->"Info3480088161-5739138"] }, Open ]], Cell[CellGroupData[{ Cell[40411, 1296, 365, 10, 31, "Input"], Cell[40779, 1308, 1085, 36, 30, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[41913, 1350, 69, 0, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[42007, 1354, 58, 1, 31, "Input"], Cell[42068, 1357, 2012, 29, 60, "Print", CellTags->"Info3480088163-1787245"] }, Open ]], Cell[CellGroupData[{ Cell[44117, 1391, 708, 24, 31, "Input"], Cell[44828, 1417, 392, 7, 30, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[45269, 1430, 77, 0, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[45371, 1434, 66, 1, 31, "Input"], Cell[45440, 1437, 413, 6, 40, "Print", CellTags->"Info3480088166-3369570"] }, Open ]], Cell[45868, 1446, 70, 0, 29, "Text"], Cell[CellGroupData[{ Cell[45963, 1450, 384, 10, 52, "Input"], Cell[46350, 1462, 305, 10, 30, "Output"], Cell[46658, 1474, 108, 3, 49, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[46815, 1483, 85, 1, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[46925, 1488, 72, 1, 31, "Input"], Cell[47000, 1491, 603, 9, 58, "Print", CellTags->"Info3480088168-3713130"] }, Open ]], Cell[CellGroupData[{ Cell[47640, 1505, 243, 7, 31, "Input"], Cell[47886, 1514, 608, 21, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[48531, 1540, 128, 3, 31, "Input"], Cell[48662, 1545, 829, 16, 50, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[49540, 1567, 79, 0, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[49644, 1571, 68, 1, 31, "Input"], Cell[49715, 1574, 344, 5, 40, "Print", CellTags->"Info3480088171-5140446"] }, Open ]], Cell[CellGroupData[{ Cell[50096, 1584, 243, 7, 31, "Input"], Cell[50342, 1593, 608, 21, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[50987, 1619, 78, 1, 31, "Input"], Cell[51068, 1622, 1525, 43, 43, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[52642, 1671, 73, 0, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[52740, 1675, 62, 1, 31, "Input"], Cell[52805, 1678, 318, 5, 40, "Print", CellTags->"Info3480088175-3638881"] }, Open ]], Cell[CellGroupData[{ Cell[53160, 1688, 243, 7, 31, "Input"], Cell[53406, 1697, 608, 21, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[54051, 1723, 72, 1, 31, "Input"], Cell[54126, 1726, 28, 0, 30, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[54203, 1732, 79, 0, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[54307, 1736, 68, 1, 31, "Input"], Cell[54378, 1739, 845, 12, 59, "Print", CellTags->"Info3480088178-6728371"] }, Open ]], Cell[CellGroupData[{ Cell[55260, 1756, 243, 7, 31, "Input"], Cell[55506, 1765, 608, 21, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[56151, 1791, 111, 2, 31, "Input"], Cell[56265, 1795, 1301, 45, 30, "Output"] }, Open ]], Cell[57581, 1843, 244, 7, 30, "Text"], Cell[CellGroupData[{ Cell[57850, 1854, 284, 8, 31, "Input"], Cell[58137, 1864, 1085, 36, 30, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[59271, 1906, 63, 0, 22, "Subsubsection"], Cell[CellGroupData[{ Cell[59359, 1910, 52, 1, 31, "Input"], Cell[59414, 1913, 232, 4, 40, "Print", CellTags->"Info3480088183-7386208"] }, Open ]], Cell[CellGroupData[{ Cell[59683, 1922, 119, 3, 31, "Input"], Cell[59805, 1927, 392, 7, 30, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[60234, 1939, 113, 3, 31, "Input"], Cell[60350, 1944, 31, 0, 30, "Output"] }, Open ]] }, Closed]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)