(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 7476, 217] NotebookOptionsPosition[ 6922, 195] NotebookOutlinePosition[ 7414, 214] CellTagsIndexPosition[ 7371, 211] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Plotting ", Cell[BoxData[ FormBox[ SubscriptBox["a", "n"], TraditionalForm]], "None"], " and ", Cell[BoxData[ FormBox[ SubscriptBox["S", "n"], TraditionalForm]], "None"] }], "Title", CellChangeTimes->{{3.480174558192356*^9, 3.480174563694138*^9}, { 3.480174624714589*^9, 3.480174674380381*^9}}, TextAlignment->Center], Cell["\<\ by Ruth Dover Illinois Mathematics and Science Academy\ \>", "Subsubtitle", CellChangeTimes->{{3.6926404926126223`*^9, 3.6926405048186398`*^9}}], Cell[TextData[{ "Below, enter any sequence you wish as a function of ", StyleBox["n", FontSlant->"Italic"], ". Then enter the initial and final values for ", StyleBox["n", FontSlant->"Italic"], ". An example is given for you. Shift-Enter and use the slider! The \ sequences are shown graphically, with ", Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["a", "n"], " "}], TraditionalForm]]], " in ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], " and ", Cell[BoxData[ FormBox[ SubscriptBox["S", "n"], TraditionalForm]]], " in ", StyleBox["blue", FontColor->RGBColor[0, 0, 1]], "." }], "Text", CellChangeTimes->{{3.480175109816642*^9, 3.480175271857217*^9}, { 3.480175342152176*^9, 3.480175381309738*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", RowBox[{"a", ",", "n", ",", " ", "nstart", ",", " ", "nfinal"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"a", "[", "n_", "]"}], ":=", FractionBox[ SuperscriptBox[ RowBox[{"(", RowBox[{"-", "1"}], ")"}], RowBox[{"n", "+", "1"}]], "n"]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"nstart", "=", "1"}], ";", " ", RowBox[{"nfinal", "=", "20"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"don", "'"}], "t", " ", "touch", " ", "the", " ", "stuff", " ", RowBox[{"below", "!"}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", RowBox[{ RowBox[{ RowBox[{"termplot", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"a", "[", "k", "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "nstart", ",", "z"}], "}"}]}], "]"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "Medium", "]"}], ",", " ", "Red"}], "}"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"sumplot", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Total", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"a", "[", "k", "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "nstart", ",", "n"}], "}"}]}], "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"n", ",", " ", "nstart", ",", "z"}], "}"}]}], "]"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "Medium", "]"}], ",", " ", "Blue"}], "}"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ylist", "=", RowBox[{"Union", "[", " ", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"a", "[", "k", "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "nstart", ",", "nfinal"}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"Total", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"a", "[", "k", "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "nstart", ",", "w"}], "}"}]}], "]"}], "]"}], ",", " ", RowBox[{"{", RowBox[{"w", ",", " ", "nstart", ",", "nfinal"}], "}"}]}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ymin", "=", RowBox[{"Min", "[", "ylist", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ymax", "=", RowBox[{"Max", "[", "ylist", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"termplot", ",", " ", "sumplot", ",", " ", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", " ", "nfinal"}], "}"}], ",", " ", RowBox[{"{", RowBox[{"ymin", ",", " ", "ymax"}], "}"}]}], "}"}]}]}], "]"}]}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"z", ",", "nstart", ",", "\"\\""}], "}"}], ",", " ", "nstart", ",", " ", "nfinal", ",", "1", ",", " ", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}]}], "]"}]}], "Input", CellChangeTimes->{{3.476231897889295*^9, 3.476231986778131*^9}, { 3.476232167644228*^9, 3.476232175499864*^9}, {3.476232225714899*^9, 3.476232437371903*^9}, {3.476232482882416*^9, 3.476232562423791*^9}, { 3.476232608825522*^9, 3.476232612488978*^9}, {3.476232651168687*^9, 3.476232743756281*^9}, 3.476232786708838*^9, {3.476232816924498*^9, 3.476232820915175*^9}, {3.476233201887395*^9, 3.476233202253542*^9}, { 3.476233263085534*^9, 3.476233270274757*^9}, {3.4762335473126583`*^9, 3.4762335643689528`*^9}, {3.476233643476862*^9, 3.476233679419598*^9}, { 3.4762339180540047`*^9, 3.476233920523457*^9}, {3.476234005313759*^9, 3.4762340176872187`*^9}, 3.476234049365251*^9, {3.476234094461934*^9, 3.4762341348920393`*^9}, {3.476234260937779*^9, 3.476234309367631*^9}, { 3.476234355767769*^9, 3.476234457202362*^9}, {3.476234500193017*^9, 3.476234529919846*^9}, {3.476234617093521*^9, 3.476234647100192*^9}, { 3.476234767152095*^9, 3.4762347842274647`*^9}, {3.4762348741192617`*^9, 3.476234879915813*^9}, {3.4762349153548098`*^9, 3.476234941961782*^9}, { 3.4762351481725397`*^9, 3.476235215641757*^9}, {3.4762353293576736`*^9, 3.4762353461647997`*^9}, {3.476235554829595*^9, 3.476235576867029*^9}, { 3.476235618161599*^9, 3.4762356290900393`*^9}, {3.47623570638527*^9, 3.476235847243394*^9}, {3.47623593320802*^9, 3.4762359642293873`*^9}}] }, Open ]] }, WindowSize->{693, 695}, WindowMargins->{{588, Automatic}, {Automatic, 53}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, PrivateNotebookOptions->{"VersionedStylesheet"->{"Default.nb"[8.] -> False}}, FrontEndVersion->"11.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September \ 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[567, 22, 352, 12, 92, "Title"], Cell[922, 36, 155, 4, 49, "Subsubtitle"], Cell[1080, 42, 742, 26, 70, "Text"], Cell[1825, 70, 5081, 122, 370, "Input"] }, Open ]] } ] *)