(* 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[ 36413, 1174] NotebookOptionsPosition[ 31234, 990] NotebookOutlinePosition[ 31824, 1014] CellTagsIndexPosition[ 31738, 1009] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Mathematica Class 2 (Given by Sriram Shastry)", "Subtitle", CellChangeTimes->{{3.4197905710328407`*^9, 3.419790598166359*^9}}], Cell[TextData[{ "Note on the ", StyleBox["Plot", FontWeight->"Bold"], " command.\n\n In versions 6, used here, a semi-colon at the end of a plot \ command means that the plot does not appear. In previous versions this was \ not the case; the semi-colon just meant that a silly message was not printed. \ Hence the ", StyleBox["Plot", FontWeight->"Bold"], " commands in the handout have semi-colon at the end. Don't do this if you \ are using version 6. There are also some changes in the options for plot \ commands which we will discuss as we go along.\n \n The following ", StyleBox["Clear", FontWeight->"Bold"], " command is useful if you want to rerun the notebook. (You don't want to \ have any defintions from the previous execution of the notebok still \ around.)" }], "Text", CellChangeTimes->{{3.4193342847484703`*^9, 3.419334549604704*^9}, { 3.4193345808046*^9, 3.4193345953086576`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "Pi"}], "}"}]}], "]"}], ";"}]], "Input", CellChangeTimes->{{3.4195536123997726`*^9, 3.419553626842309*^9}, { 3.4195988965246964`*^9, 3.4195989101835737`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"Clear", "[", "\"\\"", "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{3.4193488683140574`*^9}], Cell[CellGroupData[{ Cell["Lists", "Subsubtitle", CellChangeTimes->{{3.419350249927148*^9, 3.419350250480453*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"a", " ", "=", " ", RowBox[{"{", RowBox[{"1", ",", " ", "2", ",", " ", "3", ",", " ", "4"}], "}"}]}], ";", " ", RowBox[{"b", " ", "=", " ", RowBox[{"{", RowBox[{"1", ",", " ", "4", ",", " ", "9", ",", " ", "16"}], "}"}]}], ";"}]], "Input"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Union", "[", RowBox[{"a", ",", " ", "b"}], "]"}]], "Input", CellChangeTimes->{{3.4195991096158037`*^9, 3.419599112088841*^9}, { 3.419599143369574*^9, 3.419599151211216*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "9", ",", "16"}], "}"}]], "Output", CellChangeTimes->{ 3.419291227819119*^9, 3.4193341494741592`*^9, 3.419349064218252*^9, 3.419349172322934*^9, 3.4193493591599092`*^9, 3.419553600625533*^9, { 3.419599103192279*^9, 3.4195991129072857`*^9}, 3.419599152053254*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Intersection", "[", RowBox[{"a", ",", " ", "b"}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{"1", ",", "4"}], "}"}]], "Output", CellChangeTimes->{3.4192912279089947`*^9, 3.419334149555542*^9, 3.4193490642828283`*^9, 3.4193491723793488`*^9, 3.419349359216522*^9, 3.419553604759864*^9, 3.419599189393311*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"c", " ", "=", " ", RowBox[{"{", RowBox[{"b", ",", " ", "100"}], "}"}]}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "4", ",", "9", ",", "16"}], "}"}], ",", "100"}], "}"}]], "Output", CellChangeTimes->{3.419291228009763*^9, 3.419334149739221*^9, 3.419349064327858*^9, 3.419349172431768*^9, 3.419349359265422*^9, 3.4195992275098248`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", " ", "=", " ", RowBox[{"{", RowBox[{"a", ",", " ", "b", ",", " ", "c"}], "}"}]}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "9", ",", "16"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "4", ",", "9", ",", "16"}], "}"}], ",", "100"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.419291228110115*^9, 3.419334149827936*^9, 3.419349064378903*^9, 3.41934917247997*^9, 3.419349359333902*^9, 3.419599250380777*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"g", " ", "=", " ", RowBox[{"Flatten", "[", RowBox[{"f", ",", "1"}], "]"}]}]], "Input", CellChangeTimes->{{3.419599303495878*^9, 3.419599344886155*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "1", ",", "4", ",", "9", ",", "16", ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "9", ",", "16"}], "}"}], ",", "100"}], "}"}]], "Output", CellChangeTimes->{ 3.4192912282925873`*^9, 3.419334149922583*^9, 3.419349064446517*^9, 3.419349172530381*^9, 3.419349359408066*^9, 3.419599278810925*^9, { 3.4195993113219767`*^9, 3.4195993459536448`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"g2", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", "j", ",", "k"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", "3"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.419599359760915*^9, 3.4195993876832333`*^9}, { 3.419599464372707*^9, 3.419599465039648*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "1", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "3"}], "}"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"4", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"4", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "2", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"4", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "3", ",", "3"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"4", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "4", ",", "3"}], "}"}]}], "}"}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.419599423464492*^9, 3.419599465633355*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"g3", "=", RowBox[{"Flatten", "[", RowBox[{"g2", ",", "2"}], "]"}]}]], "Input", CellChangeTimes->{{3.419599469466901*^9, 3.4195994968294687`*^9}, { 3.4195995396997843`*^9, 3.419599547645467*^9}, {3.419599660063097*^9, 3.41959966076232*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "1", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "1", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "2", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "2", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "4", ",", "3"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.419599475152124*^9, 3.419599497945436*^9}, { 3.419599541434538*^9, 3.419599548783599*^9}, 3.4195996614759502`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Table", "[", RowBox[{ RowBox[{"g3", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "g3", "]"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.419599667663453*^9, 3.419599699725444*^9}, { 3.419599774053423*^9, 3.4195997743450108`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3", ",", "1", ",", "2", ",", "3"}], "}"}]], "Output", CellChangeTimes->{3.419599704415169*^9, 3.4195997793907013`*^9}] }, Open ]], Cell[BoxData["Tab"], "Input", CellChangeTimes->{{3.419599665954515*^9, 3.419599667085042*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"g2", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "3", ",", "2"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.419599850991927*^9, 3.419599884811791*^9}, { 3.419600018587817*^9, 3.4196001047314*^9}}], Cell[BoxData["2"], "Output", CellChangeTimes->{ 3.419291228392857*^9, 3.4193341500233507`*^9, 3.419349064513538*^9, 3.4193491725796432`*^9, 3.419349359484687*^9, {3.419599852687199*^9, 3.419599886061428*^9}, {3.419600022470235*^9, 3.419600108873027*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PrimeQ", "[", "3", "]"}]], "Input", CellChangeTimes->{{3.419600192359487*^9, 3.4196002079716253`*^9}}], Cell[BoxData["True"], "Output", CellChangeTimes->{{3.4196002026821613`*^9, 3.4196002093923492`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"l1", "=", RowBox[{"Table", "[", RowBox[{"j", ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "35"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.419600246499572*^9, 3.419600261340653*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1", ",", "2", ",", "3", ",", "4", ",", "5", ",", "6", ",", "7", ",", "8", ",", "9", ",", "10", ",", "11", ",", "12", ",", "13", ",", "14", ",", "15", ",", "16", ",", "17", ",", "18", ",", "19", ",", "20", ",", "21", ",", "22", ",", "23", ",", "24", ",", "25", ",", "26", ",", "27", ",", "28", ",", "29", ",", "30", ",", "31", ",", "32", ",", "33", ",", "34", ",", "35"}], "}"}]], "Output", CellChangeTimes->{3.4196002634472923`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Select", "[", RowBox[{"l1", ",", "PrimeQ"}], "]"}]], "Input", CellChangeTimes->{{3.4196002689262733`*^9, 3.419600303368232*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "2", ",", "3", ",", "5", ",", "7", ",", "11", ",", "13", ",", "17", ",", "19", ",", "23", ",", "29", ",", "31"}], "}"}]], "Output", CellChangeTimes->{{3.419600281726573*^9, 3.4196003043673067`*^9}}] }, Open ]], Cell[BoxData[" "], "Input", CellChangeTimes->{3.4195999958336363`*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Select", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{"n", ",", " ", RowBox[{"{", RowBox[{"n", ",", " ", "1000", ",", " ", "2000"}], "}"}]}], "]"}], ",", " ", "PrimeQ"}], "]"}]], "Input", CellChangeTimes->{{3.419600429449683*^9, 3.4196004429946947`*^9}, { 3.4196005187353487`*^9, 3.419600539315054*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1009", ",", "1013", ",", "1019", ",", "1021", ",", "1031", ",", "1033", ",", "1039", ",", "1049", ",", "1051", ",", "1061", ",", "1063", ",", "1069", ",", "1087", ",", "1091", ",", "1093", ",", "1097", ",", "1103", ",", "1109", ",", "1117", ",", "1123", ",", "1129", ",", "1151", ",", "1153", ",", "1163", ",", "1171", ",", "1181", ",", "1187", ",", "1193", ",", "1201", ",", "1213", ",", "1217", ",", "1223", ",", "1229", ",", "1231", ",", "1237", ",", "1249", ",", "1259", ",", "1277", ",", "1279", ",", "1283", ",", "1289", ",", "1291", ",", "1297", ",", "1301", ",", "1303", ",", "1307", ",", "1319", ",", "1321", ",", "1327", ",", "1361", ",", "1367", ",", "1373", ",", "1381", ",", "1399", ",", "1409", ",", "1423", ",", "1427", ",", "1429", ",", "1433", ",", "1439", ",", "1447", ",", "1451", ",", "1453", ",", "1459", ",", "1471", ",", "1481", ",", "1483", ",", "1487", ",", "1489", ",", "1493", ",", "1499", ",", "1511", ",", "1523", ",", "1531", ",", "1543", ",", "1549", ",", "1553", ",", "1559", ",", "1567", ",", "1571", ",", "1579", ",", "1583", ",", "1597", ",", "1601", ",", "1607", ",", "1609", ",", "1613", ",", "1619", ",", "1621", ",", "1627", ",", "1637", ",", "1657", ",", "1663", ",", "1667", ",", "1669", ",", "1693", ",", "1697", ",", "1699", ",", "1709", ",", "1721", ",", "1723", ",", "1733", ",", "1741", ",", "1747", ",", "1753", ",", "1759", ",", "1777", ",", "1783", ",", "1787", ",", "1789", ",", "1801", ",", "1811", ",", "1823", ",", "1831", ",", "1847", ",", "1861", ",", "1867", ",", "1871", ",", "1873", ",", "1877", ",", "1879", ",", "1889", ",", "1901", ",", "1907", ",", "1913", ",", "1931", ",", "1933", ",", "1949", ",", "1951", ",", "1973", ",", "1979", ",", "1987", ",", "1993", ",", "1997", ",", "1999"}], "}"}]], "Output", CellChangeTimes->{ 3.419291228536009*^9, 3.41933415012383*^9, 3.419349064590858*^9, 3.419349172630842*^9, 3.419349359551077*^9, 3.4196002349558077`*^9, { 3.4196004337451143`*^9, 3.419600444494095*^9}, {3.419600523828841*^9, 3.4196005401368513`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Length", "[", "%51", "]"}]], "Input", CellChangeTimes->{{3.419600564643314*^9, 3.419600574737749*^9}, { 3.419600608152257*^9, 3.419600631066267*^9}}], Cell[BoxData["135"], "Output", CellChangeTimes->{ 3.419291228626914*^9, 3.4193341502232723`*^9, 3.41934906464673*^9, 3.4193491726801558`*^9, 3.4193493596190557`*^9, {3.419600544413665*^9, 3.419600576808955*^9}, {3.419600611973177*^9, 3.419600632606717*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"OutputForm", "[", "%%", "]"}]], "Input", CellChangeTimes->{{3.4196006583728456`*^9, 3.41960067139804*^9}}], Cell[OutputFormData["\<\ 135\ \>", "\<\ 135\ \>"], "Output", CellChangeTimes->{{3.419600665779847*^9, 3.4196006723324347`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Take", "[", RowBox[{"%51", ",", RowBox[{"{", RowBox[{"1", ",", "10"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.419600706426929*^9, 3.4196007366835613`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1009", ",", "1013", ",", "1019", ",", "1021", ",", "1031", ",", "1033", ",", "1039", ",", "1049", ",", "1051", ",", "1061"}], "}"}]], "Output", CellChangeTimes->{{3.419600719923142*^9, 3.419600739144847*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "\nFunctions\nf[x]=3", StyleBox[" hello world", "Text"], "\[LineSeparator]" }], "Subsubtitle", CellChangeTimes->{{3.419350249927148*^9, 3.419350286977037*^9}, { 3.41960096494739*^9, 3.41960097217962*^9}, {3.419601052147708*^9, 3.4196010545853558`*^9}}], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"f", ",", "a", ",", "b"}], "]"}]], "Input", CellChangeTimes->{{3.4196009907256737`*^9, 3.41960099277176*^9}, { 3.4196011419391537`*^9, 3.4196011672223253`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], "=", RowBox[{"3", " ", RowBox[{"x", "^", "2"}]}]}]], "Input", CellChangeTimes->{{3.419600977421424*^9, 3.419600979526051*^9}, 3.4196011990529537`*^9, {3.419601241069975*^9, 3.419601243586203*^9}}], Cell[BoxData[ RowBox[{"3", " ", SuperscriptBox["x", "2"]}]], "Output", CellChangeTimes->{3.419600982759396*^9, 3.4196011134635153`*^9, 3.419601172713292*^9, 3.4196012057540894`*^9, 3.41960124448809*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"{", RowBox[{"a", ",", "b", ",", "d"}], "}"}], "^", "2"}]], "Input", CellChangeTimes->{{3.419601266186408*^9, 3.4196012957544413`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ SuperscriptBox["a", "2"], ",", SuperscriptBox["b", "2"], ",", SuperscriptBox["d", "2"]}], "}"}]], "Output", CellChangeTimes->{{3.41960129071378*^9, 3.419601296420665*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", "[", RowBox[{"{", RowBox[{"1", ",", "2", ",", "3"}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.419601131434371*^9, 3.4196011828291492`*^9}, { 3.419601213787539*^9, 3.419601224808935*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"3", ",", "12", ",", "27"}], "}"}]], "Output", CellChangeTimes->{{3.419601134065865*^9, 3.419601254156437*^9}, 3.419601311547572*^9}] }, Open ]], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"f", ",", " ", "a", ",", " ", "b"}], "]"}]], "Input", CellChangeTimes->{{3.419349302906818*^9, 3.419349303816169*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"k", " ", "=", " ", "10"}], ";"}]], "Input"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], " ", ":=", " ", RowBox[{"x", " ", "+", " ", RowBox[{"k", " ", RowBox[{"x", "^", "2"}]}]}]}]], "Input", CellChangeTimes->{{3.4196015549292393`*^9, 3.419601595944516*^9}, 3.419601759817919*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "f"}]], "Input", CellChangeTimes->{{3.4196017665482693`*^9, 3.419601767879874*^9}}], Cell[CellGroupData[{ Cell["Global`f", "Print", "PrintUsage", CellChangeTimes->{3.419601770980989*^9}, CellTags->"Info3419576570-9319734"], Cell[BoxData[ InterpretationBox[GridBox[{ {GridBox[{ { RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{"x", "+", RowBox[{"k", " ", SuperscriptBox["x", "2"]}]}]}]} }, BaselinePosition->{Baseline, {1, 1}}, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxItemSize->{"Columns" -> {{ Scaled[0.999]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, "RowsIndexed" -> {}}]} }, BaselinePosition->{Baseline, {1, 1}}, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}], Definition["f"], Editable->False]], "Print", CellChangeTimes->{3.419601771158634*^9}, CellTags->"Info3419576570-9319734"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", "[", "2", "]"}]], "Input"], Cell[BoxData["42"], "Output", CellChangeTimes->{3.419291228823873*^9, 3.419334150424253*^9, 3.419349064809904*^9, 3.419349172777801*^9, 3.419349359798719*^9, 3.419601447857094*^9, 3.419601624824594*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"k", " ", "=", " ", "1"}], ";"}]], "Input"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", "[", "2", "]"}]], "Input"], Cell[BoxData["42"], "Output", CellChangeTimes->{3.4192912289740763`*^9, 3.4193341505554533`*^9, 3.419349064926456*^9, 3.4193491728384237`*^9, 3.419349359914221*^9, 3.419601482438229*^9, 3.419601645476565*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", "[", "x", "]"}]], "Input"], Cell[BoxData[ RowBox[{"x", "+", SuperscriptBox["x", "2"]}]], "Output", CellChangeTimes->{3.419291229061057*^9, 3.419334150740732*^9, 3.419349064998454*^9, 3.419349172898767*^9, 3.419349359986734*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"fun", "[", RowBox[{"x_", "?", "NumericQ"}], "]"}], " ", ":=", " ", RowBox[{"x", "^", "2"}]}], ";"}]], "Input"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"fun", "[", "100", "]"}]], "Input"], Cell[BoxData["10000"], "Output", CellChangeTimes->{3.419291229204666*^9, 3.419334150890419*^9, 3.419349065166453*^9, 3.419349172961857*^9, 3.419349360167428*^9, 3.419601859862599*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"fun", "[", "x", "]"}]], "Input", CellChangeTimes->{{3.419333960037463*^9, 3.4193339621019697`*^9}}], Cell[BoxData[ RowBox[{"fun", "[", "x", "]"}]], "Output", CellChangeTimes->{3.4193341509972258`*^9, 3.419349065249016*^9, 3.419349173015491*^9, 3.419349360238329*^9, 3.419601863660681*^9}] }, Open ]], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{"fun2", "[", "x_", "]"}], ":=", RowBox[{ RowBox[{"x", "^", "2"}], " ", "/;", RowBox[{ RowBox[{"NumberQ", "[", "x", "]"}], " ", "&&", RowBox[{"EvenQ", "[", "x", "]"}]}]}]}]}]], "Input", CellChangeTimes->{{3.419601871674836*^9, 3.419601891636723*^9}, { 3.4196019319386053`*^9, 3.4196019422183447`*^9}}], Cell[BoxData[ RowBox[{"Clear", "[", "fun2", "]"}]], "Input", CellChangeTimes->{{3.419601970866982*^9, 3.419601974929015*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"fun2", "[", "3", "]"}]], "Input", CellChangeTimes->{{3.419601898249588*^9, 3.4196019035836287`*^9}, { 3.41960196284239*^9, 3.4196019843820267`*^9}}], Cell[BoxData[ RowBox[{"fun2", "[", "3", "]"}]], "Output", CellChangeTimes->{ 3.4196019043810368`*^9, {3.419601947890458*^9, 3.419601985325706*^9}}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"fun3", "[", "x_", "]"}], ":=", RowBox[{"1", " ", "/;", " ", RowBox[{"PrimeQ", "[", "x", "]"}]}]}]], "Input", CellChangeTimes->{{3.419602086876247*^9, 3.4196021071565523`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"fun3", "[", "x_", "]"}], ":=", ".2"}]], "Input", CellChangeTimes->{{3.419602111657839*^9, 3.419602118365673*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Table", "[", RowBox[{"j", ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "5"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.4196021240143843`*^9, 3.419602140551074*^9}, { 3.41960217196345*^9, 3.419602172326282*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "5"}], "}"}]], "Output", CellChangeTimes->{3.419602141227051*^9, 3.419602173538763*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Map", "[", RowBox[{"fun3", ",", "%115"}], "]"}]], "Input", CellChangeTimes->{{3.41960214380372*^9, 3.4196021796099987`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"0.2`", ",", "1", ",", "1", ",", "0.2`", ",", "1"}], "}"}]], "Output", CellChangeTimes->{{3.4196021546793623`*^9, 3.4196021804550943`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"fun3", "[", "%115", "]"}]], "Input", CellChangeTimes->{{3.419602223122246*^9, 3.419602229967576*^9}}], Cell[BoxData["0.2`"], "Output", CellChangeTimes->{3.419602231809157*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f1", " ", "=", " ", RowBox[{ RowBox[{ RowBox[{"Cos", "[", "#", "]"}], " ", "+", " ", RowBox[{"Sin", "[", "#", "]"}]}], "&"}]}]], "Input", CellChangeTimes->{{3.419333995798737*^9, 3.419334045967339*^9}, { 3.419602693704876*^9, 3.419602703966592*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Cos", "[", "#1", "]"}], "+", RowBox[{"Sin", "[", "#1", "]"}]}], "&"}]], "Output", CellChangeTimes->{3.419602704870235*^9}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"gg", "[", "x_", "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"Sin", "[", RowBox[{"3", " ", "x"}], "]"}], "^", "2"}], "+", " ", RowBox[{"11", " ", RowBox[{"ArcTan", "[", RowBox[{"1", "/", "x"}], "]"}]}]}]}]], "Input", CellChangeTimes->{{3.4196027360933313`*^9, 3.419602765778966*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"gg", "'"}], "[", ".3", "]"}]], "Input", CellChangeTimes->{{3.419602773462481*^9, 3.419602791664401*^9}}], Cell[BoxData[ RowBox[{"-", "7.1702002266314695`"}]], "Output", CellChangeTimes->{{3.4196027759118757`*^9, 3.4196027925165157`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f1", "[", RowBox[{"Pi", "/", "4"}], "]"}]], "Input", CellChangeTimes->{{3.41933405256697*^9, 3.419334056498608*^9}}], Cell[BoxData[ SqrtBox["2"]], "Output", CellChangeTimes->{ 3.419334057677874*^9, 3.4193341511930723`*^9, 3.419349065390171*^9, 3.419349173115157*^9, 3.419349360389922*^9, {3.419602687311956*^9, 3.419602698284679*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f1", "'"}]], "Input", CellChangeTimes->{{3.419334059999494*^9, 3.419334073642387*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Cos", "[", "#1", "]"}], "-", RowBox[{"Sin", "[", "#1", "]"}]}], "&"}]], "Output", CellChangeTimes->{3.419334075020382*^9, 3.419334151296775*^9, 3.4193490654699793`*^9, 3.419349173165682*^9, 3.4193493604546347`*^9, 3.4196027124697*^9}] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{765, 720}, WindowMargins->{{Automatic, 346}, {Automatic, 20}}, ShowSelection->True, FrontEndVersion->"6.0 for Linux x86 (64-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "Info3419576570-9319734"->{ Cell[24029, 732, 118, 2, 43, "Print", CellTags->"Info3419576570-9319734"], Cell[24150, 736, 862, 25, 24, "Print", CellTags->"Info3419576570-9319734"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3419576570-9319734", 31553, 1001} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 133, 1, 53, "Subtitle"], Cell[726, 26, 913, 20, 242, "Text"], Cell[1642, 48, 314, 8, 32, "Input"], Cell[1959, 58, 156, 4, 55, "Input"], Cell[CellGroupData[{ Cell[2140, 66, 94, 1, 32, "Subsubtitle"], Cell[2237, 69, 300, 9, 32, "Input"], Cell[CellGroupData[{ Cell[2562, 82, 203, 4, 32, "Input"], Cell[2768, 88, 354, 7, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3159, 100, 93, 2, 32, "Input"], Cell[3255, 104, 259, 5, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3551, 114, 113, 3, 32, "Input"], Cell[3667, 119, 308, 8, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4012, 132, 126, 3, 32, "Input"], Cell[4141, 137, 509, 14, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4687, 156, 183, 4, 32, "Input"], Cell[4873, 162, 451, 11, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5361, 178, 487, 13, 32, "Input"], Cell[5851, 193, 4660, 140, 172, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10548, 338, 276, 6, 32, "Input"], Cell[10827, 346, 3505, 100, 152, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14369, 451, 375, 10, 32, "Input"], Cell[14747, 463, 626, 10, 52, "Output"] }, Open ]], Cell[15388, 476, 95, 1, 32, "Input"], Cell[CellGroupData[{ Cell[15508, 481, 235, 5, 32, "Input"], Cell[15746, 488, 265, 4, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16048, 497, 127, 2, 32, "Input"], Cell[16178, 501, 101, 1, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16316, 507, 234, 6, 32, "Input"], Cell[16553, 515, 496, 9, 52, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17086, 529, 156, 3, 32, "Input"], Cell[17245, 534, 245, 5, 31, "Output"] }, Open ]], Cell[17505, 542, 71, 1, 32, "Input"], Cell[CellGroupData[{ Cell[17601, 547, 357, 9, 32, "Input"], Cell[17961, 558, 2171, 32, 232, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[20169, 595, 176, 3, 32, "Input"], Cell[20348, 600, 268, 4, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[20653, 609, 131, 2, 32, "Input"], Cell[20787, 613, 128, 5, 37, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[20952, 623, 200, 5, 32, "Input"], Cell[21155, 630, 256, 5, 31, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[21460, 641, 277, 7, 103, "Subsubtitle"], Cell[21740, 650, 211, 4, 32, "Input"], Cell[CellGroupData[{ Cell[21976, 658, 265, 6, 32, "Input"], Cell[22244, 666, 210, 4, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22491, 675, 174, 4, 32, "Input"], Cell[22668, 681, 223, 6, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22928, 692, 228, 5, 32, "Input"], Cell[23159, 699, 177, 4, 31, "Output"] }, Open ]], Cell[23351, 706, 167, 3, 32, "Input"], Cell[23521, 711, 78, 2, 32, "Input"], Cell[23602, 715, 265, 7, 32, "Input"], Cell[CellGroupData[{ Cell[23892, 726, 112, 2, 32, "Input"], Cell[CellGroupData[{ Cell[24029, 732, 118, 2, 43, "Print", CellTags->"Info3419576570-9319734"], Cell[24150, 736, 862, 25, 24, "Print", CellTags->"Info3419576570-9319734"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[25061, 767, 54, 1, 32, "Input"], Cell[25118, 770, 209, 3, 31, "Output"] }, Open ]], Cell[25342, 776, 77, 2, 32, "Input"], Cell[CellGroupData[{ Cell[25444, 782, 54, 1, 32, "Input"], Cell[25501, 785, 215, 3, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[25753, 793, 54, 1, 32, "Input"], Cell[25810, 796, 207, 4, 33, "Output"] }, Open ]], Cell[26032, 803, 166, 5, 32, "Input"], Cell[CellGroupData[{ Cell[26223, 812, 58, 1, 32, "Input"], Cell[26284, 815, 190, 3, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26511, 823, 124, 2, 32, "Input"], Cell[26638, 827, 192, 3, 31, "Output"] }, Open ]], Cell[26845, 833, 396, 10, 55, "Input"], Cell[27244, 845, 127, 2, 32, "Input"], Cell[CellGroupData[{ Cell[27396, 851, 175, 3, 32, "Input"], Cell[27574, 856, 151, 3, 31, "Output"] }, Open ]], Cell[27740, 862, 218, 5, 32, "Input"], Cell[27961, 869, 149, 3, 32, "Input"], Cell[CellGroupData[{ Cell[28135, 876, 256, 6, 32, "Input"], Cell[28394, 884, 167, 3, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28598, 892, 152, 3, 32, "Input"], Cell[28753, 897, 182, 4, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28972, 906, 126, 2, 32, "Input"], Cell[29101, 910, 73, 1, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[29211, 916, 291, 7, 32, "Input"], Cell[29505, 925, 174, 5, 31, "Output"] }, Open ]], Cell[29694, 933, 344, 10, 32, "Input"], Cell[CellGroupData[{ Cell[30063, 947, 140, 3, 32, "Input"], Cell[30206, 952, 133, 2, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[30376, 959, 144, 3, 32, "Input"], Cell[30523, 964, 228, 5, 35, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[30788, 974, 111, 2, 32, "Input"], Cell[30902, 978, 292, 7, 31, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)