(* 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[ 18269, 496] NotebookOptionsPosition[ 16562, 437] NotebookOutlinePosition[ 17224, 459] CellTagsIndexPosition[ 17181, 456] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"TP2", " ", "LISTES"}], " ", ";", "CORRIG\[CapitalEAcute]"}], "Subtitle"]], "Input", CellChangeTimes->{{3.459877235984375*^9, 3.459877237578125*^9}, { 3.459877293921875*^9, 3.459877300828125*^9}, {3.461500060140625*^9, 3.461500069390625*^9}, 3.461550983328125*^9, 3.46268123765625*^9}], Cell[CellGroupData[{ Cell["Ex1)", "Subsubtitle", CellChangeTimes->{{3.45987760075*^9, 3.45987760128125*^9}, { 3.461500357890625*^9, 3.461500358234375*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Table", "[", RowBox[{ RowBox[{"Cos", "[", RowBox[{"Pi", "/", "n"}], "]"}], ",", RowBox[{"{", RowBox[{"n", ",", "1", ",", "17"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.45987731115625*^9, 3.4598773188125*^9}, { 3.45987735565625*^9, 3.459877460515625*^9}, {3.46149997234375*^9, 3.461499994953125*^9}, {3.4615000380625*^9, 3.461500050796875*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0", ",", FractionBox["1", "2"], ",", FractionBox["1", SqrtBox["2"]], ",", RowBox[{ FractionBox["1", "4"], " ", RowBox[{"(", RowBox[{"1", "+", SqrtBox["5"]}], ")"}]}], ",", FractionBox[ SqrtBox["3"], "2"], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "7"], "]"}], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "8"], "]"}], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "9"], "]"}], ",", SqrtBox[ RowBox[{ FractionBox["5", "8"], "+", FractionBox[ SqrtBox["5"], "8"]}]], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "11"], "]"}], ",", FractionBox[ RowBox[{"1", "+", SqrtBox["3"]}], RowBox[{"2", " ", SqrtBox["2"]}]], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "13"], "]"}], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "14"], "]"}], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "15"], "]"}], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "16"], "]"}], ",", RowBox[{"Cos", "[", FractionBox["\[Pi]", "17"], "]"}]}], "}"}]], "Output", CellChangeTimes->{{3.45987744646875*^9, 3.45987746165625*^9}, 3.459878025*^9, 3.461499983625*^9, {3.46150004425*^9, 3.4615000528125*^9}, 3.462681370609375*^9}] }, Open ]], Cell["\<\ Mathematica est flemmard : en effet, pour n = 8, 15, 16 et 17 il y a des \ expressions avec radicaux, mais il ne les calcule pas ; par contre, pour n = \ 7, 9, 11, 13, 14, il est d\[EAcute]montr\[EAcute] qu' il n' existe en effet \ pas d' expression avec radicaux (th\[EAcute]or\[EGrave]me de Gauss).\ \>", "Text", CellChangeTimes->{{3.461500539671875*^9, 3.46150056146875*^9}, { 3.4615031265*^9, 3.461503164375*^9}, 3.4615035431875*^9}] }, Open ]], Cell[CellGroupData[{ Cell["Ex2)", "Subsubtitle", CellChangeTimes->{{3.459877604171875*^9, 3.459877604953125*^9}, { 3.4615003613125*^9, 3.461500361765625*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Permutations", "[", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.461550158234375*^9, 3.461550161875*^9}, { 3.46155061584375*^9, 3.461550708765625*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\<\"belle marquise\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"me font\"\>", ",", "\<\"mourir d'amour\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"belle marquise\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"me font\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"belle marquise\"\>", ",", "\<\"me font\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"mourir d'amour\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"belle marquise\"\>", ",", "\<\"me font\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"vos beaux yeux\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"belle marquise\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"me font\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"belle marquise\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"me font\"\>", ",", "\<\"vos beaux yeux\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"vos beaux yeux\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"me font\"\>", ",", "\<\"mourir d'amour\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"vos beaux yeux\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"me font\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"vos beaux yeux\"\>", ",", "\<\"me font\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"mourir d'amour\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"vos beaux yeux\"\>", ",", "\<\"me font\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"belle marquise\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"vos beaux yeux\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"me font\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"vos beaux yeux\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"me font\"\>", ",", "\<\"belle marquise\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"me font\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"mourir d'amour\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"me font\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"vos beaux yeux\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"me font\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"mourir d'amour\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"me font\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"belle marquise\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"me font\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"vos beaux yeux\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"me font\"\>", ",", "\<\"mourir d'amour\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"belle marquise\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"mourir d'amour\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"me font\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"mourir d'amour\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"me font\"\>", ",", "\<\"vos beaux yeux\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"mourir d'amour\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"me font\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"mourir d'amour\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"me font\"\>", ",", "\<\"belle marquise\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"mourir d'amour\"\>", ",", "\<\"me font\"\>", ",", "\<\"belle marquise\"\>", ",", "\<\"vos beaux yeux\"\>"}], "}"}], ",", RowBox[{"{", RowBox[{"\<\"mourir d'amour\"\>", ",", "\<\"me font\"\>", ",", "\<\"vos beaux yeux\"\>", ",", "\<\"belle marquise\"\>"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.46155066575*^9, 3.461550710296875*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Ex3)", "Subsubtitle", CellChangeTimes->{{3.461550966328125*^9, 3.461550967609375*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{ RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"a", "^", "2"}], "+", RowBox[{"b", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"a", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"b", ",", "0", ",", "10"}], "}"}]}], "]"}], "//", "Flatten"}], "//", "Union"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"A", "=", RowBox[{"Intersection", "[", RowBox[{"A", ",", RowBox[{"Range", "[", "100", "]"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{"Length", "[", "A", "]"}]}], "Input", CellChangeTimes->{{3.459878325296875*^9, 3.45987833028125*^9}, { 3.4615000841875*^9, 3.461500087640625*^9}, {3.46150026978125*^9, 3.4615002764375*^9}, {3.461500373125*^9, 3.46150037371875*^9}, { 3.461503072484375*^9, 3.46150307934375*^9}, {3.4615502695*^9, 3.461550307578125*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1", ",", "2", ",", "4", ",", "5", ",", "8", ",", "9", ",", "10", ",", "13", ",", "16", ",", "17", ",", "18", ",", "20", ",", "25", ",", "26", ",", "29", ",", "32", ",", "34", ",", "36", ",", "37", ",", "40", ",", "41", ",", "45", ",", "49", ",", "50", ",", "52", ",", "53", ",", "58", ",", "61", ",", "64", ",", "65", ",", "68", ",", "72", ",", "73", ",", "74", ",", "80", ",", "81", ",", "82", ",", "85", ",", "89", ",", "90", ",", "97", ",", "98", ",", "100"}], "}"}]], "Output", CellChangeTimes->{ 3.459878179921875*^9, 3.45987833278125*^9, 3.461500088953125*^9, 3.46150027775*^9, 3.461500436046875*^9, {3.461503075484375*^9, 3.461503080078125*^9}, 3.461504248484375*^9, {3.461550285125*^9, 3.46155030853125*^9}, 3.46268137740625*^9}], Cell[BoxData["43"], "Output", CellChangeTimes->{ 3.459878179921875*^9, 3.45987833278125*^9, 3.461500088953125*^9, 3.46150027775*^9, 3.461500436046875*^9, {3.461503075484375*^9, 3.461503080078125*^9}, 3.461504248484375*^9, {3.461550285125*^9, 3.46155030853125*^9}, 3.462681377453125*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Select", "[", RowBox[{"A", ",", "OddQ"}], "]"}]], "Input", CellChangeTimes->{{3.46150362503125*^9, 3.46150366346875*^9}, { 3.461504235671875*^9, 3.461504236078125*^9}, {3.462681403578125*^9, 3.46268140528125*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "1", ",", "5", ",", "9", ",", "13", ",", "17", ",", "25", ",", "29", ",", "37", ",", "41", ",", "45", ",", "49", ",", "53", ",", "61", ",", "65", ",", "73", ",", "81", ",", "85", ",", "89", ",", "97"}], "}"}]], "Output", CellChangeTimes->{{3.4615036430625*^9, 3.46150366978125*^9}, { 3.4615042373125*^9, 3.461504251375*^9}, {3.46268139121875*^9, 3.462681406484375*^9}}] }, Open ]], Cell["\<\ On peut donc penser qu' une somme de deux carr\[EAcute]s qui est impaire est \ forc\[EAcute]ment de la forme 4 k + 1; ceci est exact car si une somme de \ deux carr\[EAcute]s est impaire, l' un est pair et l' autre impair, et un \ carr\[EAcute] pair est toujours multiple de 4, tandis qu' un carr\[EAcute] \ impair est un multiple de 4 plus 1.\ \>", "Text", CellChangeTimes->{{3.4615038055625*^9, 3.461503806921875*^9}, { 3.461551071484375*^9, 3.4615510755*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{ RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"a", "^", "2"}], "+", RowBox[{"b", "^", "2"}], "+", RowBox[{"c", "^", "2"}], "+", RowBox[{"d", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"a", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"b", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"c", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"d", ",", "0", ",", "10"}], "}"}]}], "]"}], "//", "Flatten"}], "//", "Union"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"A", "=", RowBox[{"Intersection", "[", RowBox[{"A", ",", RowBox[{"Range", "[", "100", "]"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{"Length", "[", "A", "]"}]}], "Input", CellChangeTimes->{{3.461503814890625*^9, 3.46150383521875*^9}, { 3.46150387009375*^9, 3.461503928359375*^9}, 3.462681466109375*^9, { 3.46268150496875*^9, 3.462681510078125*^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", ",", "36", ",", "37", ",", "38", ",", "39", ",", "40", ",", "41", ",", "42", ",", "43", ",", "44", ",", "45", ",", "46", ",", "47", ",", "48", ",", "49", ",", "50", ",", "51", ",", "52", ",", "53", ",", "54", ",", "55", ",", "56", ",", "57", ",", "58", ",", "59", ",", "60", ",", "61", ",", "62", ",", "63", ",", "64", ",", "65", ",", "66", ",", "67", ",", "68", ",", "69", ",", "70", ",", "71", ",", "72", ",", "73", ",", "74", ",", "75", ",", "76", ",", "77", ",", "78", ",", "79", ",", "80", ",", "81", ",", "82", ",", "83", ",", "84", ",", "85", ",", "86", ",", "87", ",", "88", ",", "89", ",", "90", ",", "91", ",", "92", ",", "93", ",", "94", ",", "95", ",", "96", ",", "97", ",", "98", ",", "99", ",", "100"}], "}"}]], "Output", CellChangeTimes->{ 3.461503842265625*^9, {3.4615038725625*^9, 3.461503878734375*^9}, { 3.461503920015625*^9, 3.4615039296875*^9}, 3.462681511265625*^9}], Cell[BoxData["100"], "Output", CellChangeTimes->{ 3.461503842265625*^9, {3.4615038725625*^9, 3.461503878734375*^9}, { 3.461503920015625*^9, 3.4615039296875*^9}, 3.4626815113125*^9}] }, Open ]], Cell["\<\ On peut donc penser que tout naturel est somme de 4 carr\[EAcute]s, ce qui \ est exact, mais difficile \[AGrave] d\[EAcute]montrer.\ \>", "Text", CellChangeTimes->{{3.463845949015625*^9, 3.463845954046875*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{ RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"a", "^", "2"}], "+", RowBox[{"b", "^", "2"}], "+", RowBox[{"c", "^", "2"}]}], ",", RowBox[{"{", RowBox[{"a", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"b", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"c", ",", "0", ",", "10"}], "}"}]}], "]"}], "//", "Flatten"}], "//", "Union"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"B", "=", RowBox[{"Intersection", "[", RowBox[{"A", ",", RowBox[{"Range", "[", "100", "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"CC", "=", RowBox[{"Intersection", "[", RowBox[{ RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"a", " ", "b"}], ",", RowBox[{"{", RowBox[{"a", ",", "B"}], "}"}], ",", RowBox[{"{", RowBox[{"b", ",", "B"}], "}"}]}], "]"}], "//", "Flatten"}], ",", RowBox[{"Range", "[", "100", "]"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"DD", "=", RowBox[{"Complement", "[", RowBox[{"CC", ",", "B"}], "]"}]}]}], "Input", CellChangeTimes->{{3.461504078265625*^9, 3.461504083359375*^9}, { 3.461505698234375*^9, 3.4615057056875*^9}, {3.4615059660625*^9, 3.461506098203125*^9}, {3.461506183296875*^9, 3.461506244484375*^9}, { 3.46268155040625*^9, 3.46268155678125*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ "15", ",", "28", ",", "39", ",", "55", ",", "60", ",", "63", ",", "87", ",", "92", ",", "95"}], "}"}]], "Output", CellChangeTimes->{ 3.46150605371875*^9, {3.461506093140625*^9, 3.46150609925*^9}, 3.461506188375*^9, {3.461506218890625*^9, 3.461506240296875*^9}, 3.46150631903125*^9, 3.462681558828125*^9}] }, Open ]], Cell["\<\ DD est la liste des nombres entre 0 et 100 qui sont produit de 2 sommes de 3 \ carr\[EAcute]s sans \[EHat]tre somme de 3 carr\[EAcute]s. Contrairement aux sommes de deux carr\[EAcute]s, les sommes de trois carr\ \[EAcute]s ne sont donc pas stables par produits.\ \>", "Text", CellChangeTimes->{{3.46150632215625*^9, 3.461506332484375*^9}, { 3.46220668946875*^9, 3.46220674771875*^9}, {3.46384596584375*^9, 3.463845967453125*^9}}] }, Open ]] }, WindowToolbars->"EditBar", WindowSize->{1339, 665}, WindowMargins->{{Automatic, 0}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, PrintingOptions->{"PrintingMargins"->{{54.000000584999995`, \ 54.000000584999995`}, {56.692913999999995`, 56.692913999999995`}}}, Magnification:>FEPrivate`If[ FEPrivate`Equal[FEPrivate`$VersionNumber, 6.], 1.5, 1.5 Inherited], FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (February 18, 2009)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 344, 7, 65, "Input"], Cell[CellGroupData[{ Cell[914, 31, 137, 2, 42, "Subsubtitle"], Cell[CellGroupData[{ Cell[1076, 37, 401, 9, 43, "Input"], Cell[1480, 48, 1351, 44, 146, "Output"] }, Open ]], Cell[2846, 95, 451, 7, 66, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3334, 107, 140, 2, 42, "Subsubtitle"], Cell[CellGroupData[{ Cell[3499, 113, 329, 7, 43, "Input"], Cell[3831, 122, 4050, 87, 618, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7930, 215, 93, 1, 42, "Subsubtitle"], Cell[CellGroupData[{ Cell[8048, 220, 930, 24, 98, "Input"], Cell[8981, 246, 819, 14, 68, "Output"], Cell[9803, 262, 301, 5, 42, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10141, 272, 246, 5, 43, "Input"], Cell[10390, 279, 425, 8, 42, "Output"] }, Open ]], Cell[10830, 290, 476, 8, 66, "Text"], Cell[CellGroupData[{ Cell[11331, 302, 1057, 28, 98, "Input"], Cell[12391, 332, 1367, 21, 118, "Output"], Cell[13761, 355, 187, 3, 42, "Output"] }, Open ]], Cell[13963, 361, 221, 4, 41, "Text"], Cell[CellGroupData[{ Cell[14209, 369, 1513, 44, 125, "Input"], Cell[15725, 415, 361, 8, 42, "Output"] }, Open ]], Cell[16101, 426, 445, 8, 66, "Text"] }, Open ]] } ] *) (* End of internal cache information *)