{VERSION 3 0 "IBM INTEL LINUX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 256 "" 0 1 255 0 0 1 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 255 0 0 1 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "terminal" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "terminal" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 276 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 281 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 282 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 283 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 284 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 285 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 286 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 287 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 288 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 289 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 290 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 291 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 292 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 293 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 294 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 295 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 296 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 297 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 298 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 299 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 300 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 301 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 302 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 303 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 304 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 305 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 306 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "" 2 6 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Map le Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } 3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 " " 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 32 "Maple Tutorial for Number Theory" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 12 "Introduction" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 150 " \+ On most platforms, you start Maple by double-clicking on the Maple icon. However, in our Computer Lab in HH-3030/3056 you can simply typ e " }{TEXT 256 6 "xmaple" }{TEXT -1 4 " or " }{TEXT 257 8 "xmaple &" } {TEXT -1 155 " to start a Maple session. If you are familiar with the \+ Unix environment you can create a Maple subdirectory and start Maple f rom within that subdirectory." }}{PARA 0 "" 0 "" {TEXT -1 44 " \+ At the top of the window is the " }{TEXT 258 8 "menu bar" }{TEXT -1 26 " containing such menus as " }{TEXT 259 4 "File" }{TEXT -1 5 " a nd " }{TEXT 260 4 "Edit" }{TEXT -1 40 ". Immediately below the menu ba r is the " }{TEXT 261 8 "tool bar" }{TEXT -1 138 ", which contains but ton-based shortcuts to common operations such as opening, saving, and \+ printing. Immediately below the tool bar is the " }{TEXT 262 12 "conte xt bar " }{TEXT -1 369 "which contains controls specific to the task y ou are currently performing. The next area is large and displays your \+ worksheet, the region in which you work. At the bottom of the window i s the status bar, which displays system information. The worksheet sho uld have opened with the prompt (>) in the upper left corner. This wor ksheet can be downloaded from my home page " }{TEXT 282 32 "http://www .math.mun.ca/~drideout" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 236 " We will introduce Maple commands which will be useful for this Number Theory Manual. Our section headings will be the chapt ers of the Manual and we will try to give all the commands to help wit h the chapter under discussion." }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 34 "Chapter 1 Primes & Perfect Numbers" }}{PARA 0 "" 0 "" {TEXT -1 73 " Note Theorem 1.1 in Chapter 1. We can certainly check t hat " }{XPPEDIT 18 0 "sum(x^i,i = 0 .. n-1) = (x^n-1)/(x-1);" "6#/-%$s umG6$)%\"xG%\"iG/F);\"\"!,&%\"nG\"\"\"\"\"\"!\"\"*&,&)F(F.F/\"\"\"F1F/ ,&F(F/\"\"\"F1F1" }{TEXT -1 25 " for specific examples:" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "factor(x^5-1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&,&%\"xG\"\" \"!\"\"F&F&,,*$)F%\"\"%\"\"\"F&*$)F%\"\"$F,F&*$)F%\"\"#F,F&F%F&F&F&F& " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "simplify((x^12-1)/(x-1));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,:*$)%\"xG\"#6\"\"\"\"\"\"*$)F&\"#5F(F)*$)F&\"\"*F(F)*$ )F&\"\")F(F)*$)F&\"\"(F(F)*$)F&\"\"'F(F)*$)F&\"\"&F(F)*$)F&\"\"%F(F)*$ )F&\"\"$F(F)*$)F&\"\"#F(F)F&F)F)F)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "normal((x^12-1)/( x-1));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,:*$)%\"xG\"#6\"\"\"\"\"\"*$ )F&\"#5F(F)*$)F&\"\"*F(F)*$)F&\"\")F(F)*$)F&\"\"(F(F)*$)F&\"\"'F(F)*$) F&\"\"&F(F)*$)F&\"\"%F(F)*$)F&\"\"$F(F)*$)F&\"\"#F(F)F&F)F)F)" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 " The " }{TEXT 263 6 "normal" }{TEXT -1 73 " command wi ll always reduce a rational function to the lowest terms. The " } {TEXT 264 6 "factor" }{TEXT -1 129 " command will factor a polynomial \+ with rational coefficients into irreducible factors over the ring of i ntegers. So for example, " }{TEXT 265 6 "factor" }{TEXT -1 24 "(x^12-1 ), will not give " }{XPPEDIT 18 0 "(x-1)(x^11+x^10+x^9+x^8+x^7+x^6+x^5 +x^4+x^3+x^2+x+1)" "6#-,&%\"xG\"\"\"\"\"\"!\"\"6#,:*$F%\"#6F&*$F%\"#5F &*$F%\"\"*F&*$F%\"\")F&*$F%\"\"(F&*$F%\"\"'F&*$F%\"\"&F&*$F%\"\"%F&*$F %\"\"$F&*$F%\"\"#F&F%F&\"\"\"F&" }{TEXT -1 20 ", but the following:" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "factor(x^12-1);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#*.,&%\"xG\"\"\"!\"\"F&F&,&F%F&F&F&F&,( *$)F%\"\"#\"\"\"F&F%F&F&F&F&,(F*F&F%F'F&F&F&,&F*F&F&F&F&,(*$)F%\"\"%F- F&F*F'F&F&F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "factor(x^28-1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*.,&%\"xG\"\"\"!\"\"F&F&,0*$)F%\"\"'\"\"\"F&*$)F%\"\"&F ,F&*$)F%\"\"%F,F&*$)F%\"\"$F,F&*$)F%\"\"#F,F&F%F&F&F&F&,&F%F&F&F&F&,0F &F&F%F'F6F&F3F'F0F&F-F'F)F&F&,&F6F&F&F&F&,0*$)F%\"#7F,F&*$)F%\"#5F,F'* $)F%\"\")F,F&F)F'F0F&F6F'F&F&F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 " The semi-colon (;) \+ is necessary at the end of a Maple command. Is it true that " }{TEXT 266 6 "factor" }{TEXT -1 92 "(x^n-1) will always give factors with coe fficients +1 or -1? Try experimenting with various " }{XPPEDIT 18 0 "n " "6#%\"nG" }{TEXT -1 27 " and form a conjecture. If " }{XPPEDIT 18 0 "n=p" "6#/%\"nG%\"pG" }{TEXT -1 16 ", a prime, then " }{TEXT 270 6 "fa ctor" }{TEXT -1 25 "(x^p-1) will always give " }{XPPEDIT 18 0 "(x-1)*s um(x^i,i = 0 .. p-1);" "6#*&,&%\"xG\"\"\"\"\"\"!\"\"F&-%$sumG6$)F%%\"i G/F-;\"\"!,&%\"pGF&\"\"\"F(F&" }{TEXT -1 23 ". Hence the polynomial " }{XPPEDIT 18 0 "sum(x^i,i = 0 .. p-1);" "6#-%$sumG6$)%\"xG%\"iG/F(;\" \"!,&%\"pG\"\"\"\"\"\"!\"\"" }{TEXT -1 145 " must be irreducible. This is not trivial to prove. To start experimenting you can start a new i nput field below this text field by clicking the " }{TEXT 281 2 "[>" } {TEXT -1 15 " button on the " }{TEXT 283 8 "tool bar" }{TEXT -1 7 " ab ove." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 150 " Following along in Chapter 1 we come to the F ibonacci sequence. Does Maple know this sequence? The natural thing to do is to enter the query " }{TEXT 267 10 "?fibonacci" }{TEXT -1 52 ". This will introduce you to the useful online help." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "? fibonacci" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 176 " The above command (note we did not need \+ the semi-colon here) produces a help screen with the statement: ``Ther e are several matching topics. Try one of the following: " }{TEXT 278 38 "linalg, fibonacci, combinat fibonacci." }{TEXT -1 15 "'' Clicking \+ on " }{TEXT 279 18 "combinat fibonacci" }{TEXT -1 29 " will produce wh at you need. " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "fibonacci(10);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%*fibonacciG6#\"#5" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 246 " This did not \+ give the desired result. When Maple does not know what to do, it simpl y prints what is on the input line. Note from the help screen that we \+ need to ``load'' part or all of the combinatorial package. We can do t his by typing " }{TEXT 268 14 "with(combinat)" }{TEXT -1 16 "; or as f ollows:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 24 "combinat[fibonacci](10);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#b" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "If we wanted to produce the first \+ 19 fibonacci numbers we can use the " }{TEXT 269 8 "sequence" }{TEXT -1 17 " command. (Type ?" }{TEXT 271 3 "seq" }{TEXT -1 39 " to read th e help screen on sequences.)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "seq(combinat[fibonacci](i ),i=1..19);" }}{PARA 11 "" 1 "" {XPPMATH 20 "65\"\"\"F#\"\"#\"\"$\"\"& \"\")\"#8\"#@\"#M\"#b\"#*)\"$W\"\"$L#\"$x$\"$5'\"$()*\"%(f\"\"%%e#\"% \"=%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 96 " Before we finish with the Fibonnaci numbers, rea d Problem #12 in Chapter 1. It says that " }{XPPEDIT 18 0 "F[n] = (alp ha^n-beta^n)/sqrt(5);" "6#/&%\"FG6#%\"nG*&,&)%&alphaGF'\"\"\")%%betaGF '!\"\"F,-%%sqrtG6#\"\"&F/" }{TEXT -1 7 " where " }{XPPEDIT 18 0 "alpha = (1+sqrt(5))/2;" "6#/%&alphaG*&,&\"\"\"\"\"\"-%%sqrtG6#\"\"&F(F(\"\" #!\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "beta = 1-sqrt(5)/2;" "6#/% %betaG,&\"\"\"\"\"\"*&-%%sqrtG6#\"\"&F'\"\"#!\"\"F." }{TEXT -1 26 ". W e can confirm this for " }{XPPEDIT 18 0 "n = 19;" "6#/%\"nG\"#>" } {TEXT -1 6 ", say." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "alpha:=(1+sqrt(5))/2;" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%&alphaG,&#\"\"\"\"\"#F'*$-%%sqrtG6#\"\"&\"\"\" F&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "beta:=(1-sqrt(5))/2; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%betaG,&#\"\"\"\"\"#F'*$-%%sqrtG 6#\"\"&\"\"\"#!\"\"F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "F[ 19]:=(alpha^19-beta^19)/sqrt(5);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>& %\"FG6#\"#>,$*&,&*$),&#\"\"\"\"\"#F/*$-%%sqrtG6#\"\"&\"\"\"F.F'F6F/*$) ,&F.F/F1#!\"\"F0F'F6F;F/F2F6#F/F5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "simplify(F[19]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# \"%\"=%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 " Take a careful look at the above. Note that t he name " }{TEXT 276 5 "alpha" }{TEXT -1 29 " has been assigned the va lue " }{XPPEDIT 18 0 "(1+sqrt(5))/2;" "6#*&,&\"\"\"\"\"\"-%%sqrtG6#\" \"&F&F&\"\"#!\"\"" }{TEXT -1 79 ". And it will always remain so in thi s worksheet unless we unassign the symbol " }{TEXT 277 6 "alpha " } {TEXT -1 33 "by issuing the following command:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "alpha: ='alpha';" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&alphaGF$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 181 " The next idea is that of primes and in particular Mersenne prim es and perfect numbers. Again we try to find out what Maple knows abou t these ideas. So we try the help screen:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "?mersenne" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 136 " The help screen tells us about the various Merse nne functions. If you load up the Number Theory package by issuing the command " }{TEXT 274 15 "with(numtheory)" }{TEXT -1 32 ": then you w ill not need to put " }{TEXT 280 9 "numtheory" }{TEXT -1 100 " in fron t of the functions, as shown below. If you change the colon to a semi- colon, that is, load " }{TEXT 275 15 "with(numtheory)" }{TEXT -1 141 "; then all of the number theory functions will be listed. In general, using (:) instead of (;) will suppress the output from a Maple comman d." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 23 "numtheory[mersenne](7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"$F\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "2^7 -1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"$F\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "numtheory[mersenne]([7]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"'(GC&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "2^ 19-1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"'(GC&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "numtheory[mersenne](11);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%&falseG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " ifactor(2^11-1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&-%!G6#\"#B\"\"\" -F%6#\"#*)F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "numtheory[m ersenne](224737);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%&falseG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "isprime(224737);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%%trueG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 34 " Note the two new fu nctions " }{TEXT 272 7 "ifactor" }{TEXT -1 5 " and " }{TEXT 273 7 "isp rime" }{TEXT -1 82 ". For more information, you can read the help scre ens for each of these functions." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 " The last topic to \+ be introduced in Chapter 1 is Fermat primes. Again we look at the help screen " }{TEXT 284 7 "?fermat" }{TEXT -1 85 " and see that there is \+ a Fermat function, which is part of the Number Theory package." }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "numtheory[fermat](8,'w');" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"ioP*R'HJ\"z+%ed%RScScm%)*pK&y!zo3])4dBa>;tB*3#z:\"" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "w;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%:it~has~this~prime~factor~G,&*()-%!G6#\"\"#\"#6\"\"\"- F(6#\"$d\"\"\"\"-F(6#\"+h(\\J&QF0F0F0F0" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "numtheory[fermat](n);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&)\"\"#)F%%\"nG\"\"\"F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "numtheory[fermat](5,'w');" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"+(Hn\\H%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "w;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%;it~is~completely~factored~G*& -%!G6#,&*&)-F&6#\"\"#\"\"(\"\"\"-F&6#\"\"&\"\"\"F3F3F3F3-F&6#,&*(F*F/- F&6#\"\"$F3-F&6#\"&\\u\"F3F3F3F3F3" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 23 "Chapter 2 Divisibility" }}{PARA 0 "" 0 "" {TEXT -1 7 " \+ " }}{PARA 0 "" 0 "" {TEXT -1 24 " The help screens " }{TEXT 285 6 "?iquo," }{TEXT -1 1 " " }{TEXT 286 5 "?irem" }{TEXT -1 2 ", " } {TEXT 287 5 "?igcd" }{TEXT -1 2 ", " }{TEXT 288 8 "?igcdex," }{TEXT -1 4 "and " }{TEXT 289 7 "?isolve" }{TEXT -1 101 " should be examined. Note that these functions can be used without loading the Number Theo ry package." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "iquo(275,61,'r');r;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#J" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "iquo(-275,61,'r');r;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#!\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#!#J" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "igcd(679,210);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "igcdex(679,210,'s','t');s;t;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"(" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#8" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!#U" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "r:=isolve(8*x+5*y=100);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"r G<$/%\"xG,$%$_N1G\"\"&/%\"yG,&\"#?\"\"\"F)!\")" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 10 "indets(r);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# <%%\"yG%\"xG%$_N1G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "op(3,% );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%$_N1G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 131 "subs(op(3,indets(r))=3, r); # Substitute 3 fo r _N1 in r. The stuff after the (#) is a comment and does not affect t he input line." }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<$/%\"yG!\"%/%\"xG\" #:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 " Maple has several " }{TEXT 290 3 "gcd" }{TEXT -1 102 " programs written in Maple's high-level programming language. You can view these in the following way:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "interface(v erboseproc=2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "print(igc dex);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#R6&%\"aG%\"bG%\"sG%\"tG6&%\"g G%\"pG%\"qG%\"uG6#%aoCopyright~(c)~1990~by~the~University~of~Waterloo. ~All~rights~reserved.G6\"C(@$43-%%typeG6$9$%(integerG-F66$9%F9-%&ERROR G6#%2invalid~argumentsG>8$-%%igcdG6$F8F<@)/FB\"\"!>8'7$FHFH/F8FH>FJ7$F H-%%signG6#FFJ7$-FP6#F8FHC&>8%-%%iquoG6$F8FB>8&-Fen6$FFJ-%% modsG6$*&\"\"\"F`oFY!\"\"Fhn>FJ7$FJ-Fen6$,&\"\"\"Fgo*&FJFgoFYFgo!\"\"F hn@$2\"\"#9#>9&&FJ6#Fgo@$2\"\"$F]p>9'&FJ6#F\\pFBF0F0F0" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "print(igcd);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#R6\"F$6#%(builtinGF$\"$:\"F$F$F$%%igcdG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 " \+ Most of Maple's programs can be viewed, but about 5% cannot. For example, " }{TEXT 291 4 "igcd" }{TEXT -1 2 ", " }{TEXT 292 4 "iquo" } {TEXT -1 6 ", and " }{TEXT 293 4 "irem" }{TEXT -1 99 " cannot be viewe d. Maple has its own C-type programming language. We can write our own gcd program:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 276 "mygcd:=proc(x::integer,y::integer) \nlocal a, b, g, q, temp;\n a:=abs(x);\n b:=abs(y);\n if a=0 \+ and b=0 then ERROR(`Both arguments cannot be zero.`);\n elif a=0 th en g:=b;\n else\n while 0 " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%&mygcdGR6$'%\"xG %(integerG'%\"yGF)6'%\"aG%\"bG%\"gG%\"qG%%tempG6\"F2C&>8$-%$absG6#9$>8 %-F76#9%@'3/F5\"\"!/F;FB-%&ERRORG6#%?Both~arguments~cannot~be~zero.GFA >8&F;C$?(F2\"\"\"FLF22FBF;C&>8'-%&truncG6#*&F5\"\"\"F;!\"\">8(F;>F;,&F 5FL*&FPFLF;FL!\"\">F5FX>FIF5FIF2F2F2" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "mygcd(679,210);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "mygcd(0,0);" }}{PARA 8 "" 1 "" {TEXT -1 48 "Error, (i n mygcd) Both arguments cannot be zero." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 140 " I have a li ttle disagreement with Waterloo Maple. With our definition of gcd, we \+ cannot take the gcd of zero and zero, but the builtin " }{TEXT 302 4 " igcd" }{TEXT -1 50 " program seems not to have any problems with that! " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "igcd(0,0);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 428 " You need to be careful entering a program in an inp ut field. The carriage return is not the ``enter'' button. If you hit \+ the enter button, you will get an error, since Maple is expecting a (; ) so that the line can be executed. The carriage return to put you on \+ a new line is shift-enter. The better way to enter one of your own pro grams is to type it with the help of your favorite editor, for example my favorite one, the " }{TEXT 294 2 "vi" }{TEXT -1 13 " editor, and \+ " }{TEXT 303 4 "read" }{TEXT -1 113 " it in. If you are working in the local subdirectory where the program is located, the following comman d will do:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "read`mygcd.txt`;" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%&mygcdGR6$'%\"xG%(integerG'%\"yGF)6'%\"aG%\"bG%\"gG% \"qG%%tempG6\"F2C&>8$-%$absG6#9$>8%-F76#9%@)3/F5\"\"!/F;FB-%&ERRORG6#% ?Both~arguments~cannot~be~zero.GFA>8&F;FC>FIF5C$?(F2\"\"\"FMF22FBF;C&> 8'-%&truncG6#*&F5\"\"\"F;!\"\">8(F;>F;,&F5FM*&FQFMF;FM!\"\">F5FY>FIF5F IF2F2F2" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 125 " Before leaving this chapter, we will show ho w Maple can help solve the following problem, appropriate to this chap ter." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 297 7 "P roblem" }{TEXT -1 65 " You have an inexhaustible supply of two kinds \+ of stamps -- say " }{TEXT 298 1 "a" }{TEXT -1 10 " cent and " }{TEXT 299 1 "b" }{TEXT -1 288 " cent. Which amounts can be made using just t hese stamps? Which amounts cannot be made? For certain pairs of stamps it appears that after a certain point all denominations can be made. \+ In those cases, find a formula for the largest amount that cannot be a chieved. Now, prove your formula." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 96 " Since we are lazy, we will write a short program to help with the experimentation. Given " }{TEXT 300 1 "a" }{TEXT -1 5 " and " }{TEXT 301 1 "b" }{TEXT -1 62 " we need to be \+ able to generate a list of linear combinations " }{XPPEDIT 18 0 "a*x+b *y;" "6#,&*&%\"aG\"\"\"%\"xGF&F&*&%\"bGF&%\"yGF&F&" }{TEXT -1 103 ". S tudy the following program and look up the help screens for any word o r operation that is not clear." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 205 "lincom:=proc(a,b,n)\n \+ local i,j,s,m;\n s:=\{\};\n for i from 0 to n do\n for j fr om 0 to n do\n m:=a*i+b*j;\n if m<=n then s:=\{op(s),m \} fi\n od;\n od;\n lprint(sort([op(s)]));\nend;" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%'lincomGR6%%\"aG%\"bG%\"nG6&%\"iG%\"jG%\"sG% \"mG6\"F/C%>8&<\"?(8$\"\"!\"\"\"9&%%trueG?(8%F6F7F8F9C$>8',&*&9$F7F5F7 F7*&9%F7F;F7F7@$1F>F8>F2<$F>-%#opG6#F2-%'lprintG6#-%%sortG6#7#FHF/F/F/ " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "lincom(3,5,20);" }}{PARA 6 "" 1 "" {TEXT -1 62 "[0, 3 , 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "lincom(5,23,130);" }}{PARA 6 "" 1 "" {TEXT -1 377 "[0, 5, 10, 15 , 20, 23, 25, 28, 30, 33, 35, 38, 40, 43, 45, 46, 48, 50, 51, 53, 55, \+ 56, 58, 60, 61, 63, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 80 , 81, 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \+ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, \+ 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, \+ 128, 129, 130]" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 17 "Chapter 3 Primes" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 120 " Look through the \+ list of functions in the Number Theory package. There are several ther e that you should explore." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(numtheory);" }}{PARA 7 "" 1 "" {TEXT -1 29 "Warning, new definition for F" }}{PARA 7 "" 1 "" {TEXT -1 33 "Warning, new definition for order" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#7gn%\"BG%\"FG%&GIgcdG%\"JG%\"LG%\"MG%*bernoulliG%)bigom egaG%&cfracG%)cfracpolG%+cyclotomicG%)divisorsG%&eulerG%)factorEQG%*fa ctorsetG%'fermatG%(ifactorG%)ifactorsG%)imagunitG%&indexG%/integral_ba sisG%)invcfracG%'invphiG%'isolveG%(isprimeG%*issqrfreeG%)ithprimeG%'ja cobiG%*kroneckerG%'lambdaG%)legendreG%)mcombineG%)mersenneG%*minkowski G%(mipolysG%%mlogG%'mobiusG%&mrootG%&msqrtG%)nearestpG%*nextprimeG%*nt hconverG%)nthdenomG%)nthnumerG%'nthpowG%&orderG%)pdexpandG%$phiG%*ppri mrootG%*prevprimeG%)primrootG%(quadresG%+rootsunityG%*safeprimeG%&sigm aG%*sq2factorG%(sum2sqrG%$tauG%%thueG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "s:=NULL: fo r i to 100 do s:=s,ithprime(i) od: s;" }}{PARA 12 "" 1 "" {XPPMATH 20 "6`q\"\"#\"\"$\"\"&\"\"(\"#6\"#8\"#<\"#>\"#B\"#H\"#J\"#P\"#T\"#V\"#Z\" #`\"#f\"#h\"#n\"#r\"#t\"#z\"#$)\"#*)\"#(*\"$,\"\"$.\"\"$2\"\"$4\"\"$8 \"\"$F\"\"$J\"\"$P\"\"$R\"\"$\\\"\"$^\"\"$d\"\"$j\"\"$n\"\"$t\"\"$z\" \"$\"=\"$\">\"$$>\"$(>\"$*>\"$6#\"$B#\"$F#\"$H#\"$L#\"$R#\"$T#\"$^#\"$ d#\"$j#\"$p#\"$r#\"$x#\"$\"G\"$$G\"$$H\"$2$\"$6$\"$8$\"$<$\"$J$\"$P$\" $Z$\"$\\$\"$`$\"$f$\"$n$\"$t$\"$z$\"$$Q\"$*Q\"$(R\"$,%\"$4%\"$>%\"$@% \"$J%\"$L%\"$R%\"$V%\"$\\%\"$d%\"$h%\"$j%\"$n%\"$z%\"$([\"$\"\\\"$*\\ \"$.&\"$4&\"$@&\"$B&\"$T&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "prevprime(10000);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"%t**" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "divisors(28);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#<(\"\"\"\"\"#\"\"%\"\"(\"#9\"#G" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "d:=[op(%)];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"dG7(\"\"\"\"\"#\"\"%\"\"(\"#9\"#G" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sum(d['i'],'i'=1..5);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#\"#G" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 201 " Observe the above constru ctions. Note how we listed the first 100 primes. The symbol (%) refers to the previous output. Again, without my constant prompting, you sho uld look at the help screens " }{TEXT 295 3 "?op" }{TEXT -1 5 " and " }{TEXT 296 4 "?sum" }{TEXT -1 334 ". Note that we have proved that 28 \+ is a perfect number. Below note the definition of Li(x) from the appro priate help screen, and read Problem #18 in Chapter 3. The decimal poi nt is necessary since the argument of the function Li(x) must be a ``f loating point'' number rather than an integer. Note how we can define \+ functions in Maple." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Li(10000.);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+;s8Y7!\"'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 115 "nops(select(isprime,[$1..10000]));#This counts the e xact number of primes. Read the help screens for select & nops." }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"%H7" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "f:=x->x/ln(x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>% \"fGR6#%\"xG6\"6$%)operatorG%&arrowGF(*&9$\"\"\"-%#lnG6#F-!\"\"F(F(F( " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "f(10000.);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+0it&3\"!\"'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 22 "Chapter 4 Cong ruences" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 63 " The help screen that is most helpful in this chapter is " } {TEXT 304 4 "?mod" }{TEXT -1 2 ". " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "12 mod 7;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "modp(12,7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"&" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "mods(12,7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 " 2^18+1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"'X@E" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 9 "% mod 37;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# \"\"!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "7^(-1) mod 9;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "1/7 mod 9;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "1/289 mod 326;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"$&=" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "phi(12);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "'phi'(12)=phi(12);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%$phiG6#\"#7\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "7 &^ 254 mod 10;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# \"\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "2 &^ 561 mod 561; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 23 "2 &^ 161038 mod 161038;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "(13 -1)! mod 13;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#7" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "(4001-1)! mod 4001;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"%+S" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "mod s((4001-1)!,4001);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "msolve(x^2=-1,17);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$<#/%\"xG\"#8<#/F%\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "mods(13^2,17);mods(4^2,17);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "sum2sqr(17);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#7$\"\"%\"\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "sum2sqr(31);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "mods(sum(j^(101-1),j=1..1 00),101);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"\"" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 63 "Chapter 5 Linear Congruences and the Chinese R emainder Theorem" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 125 " We have already discussed many of the functions a nd commands needed for congruences. We give just a few more examples. " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "msolve(14*x=5,33);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #<#/%\"xG\"#J" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "msolve(596 *x=107,1001);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<#/%\"xG\"$*\\" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "msolve(33*x=15,45); #Note th at all the incongruent solutions are given." }}{PARA 11 "" 1 "" {XPPMATH 20 "6%<#/%\"xG\"#S<#/F%\"#D<#/F%\"#5" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "chrem([2,4,5],[7,11,13]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"$*\\" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}} {SECT 0 {PARA 3 "" 0 "" {TEXT -1 56 "Chapter 6 The Multiplicative Gro up of Integers Modulo m" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 63 " We have been introduced already to Euler's Ph i function " }{XPPEDIT 18 0 "phi(x);" "6#-%$phiG6#%\"xG" }{TEXT -1 75 ". Remember that you will need to load the Nuber Theory package to eva luate " }{XPPEDIT 18 0 "phi(x);" "6#-%$phiG6#%\"xG" }{TEXT -1 140 ". W e do very little group theory in this chapter. There is a Group Theory package on Maple which you can investigate by beginning the query " } {TEXT 305 6 "?group" }{TEXT -1 73 ". As an exercise, write a procedure to calculate the order of an element " }{XPPEDIT 18 0 "a;" "6#%\"aG" }{TEXT -1 8 " modulo " }{XPPEDIT 18 0 "m;" "6#%\"mG" }{TEXT -1 5 ", if " }{XPPEDIT 18 0 "(a, m) = 1;" "6#/6$%\"aG%\"mG\"\"\"" }{TEXT -1 1 ". " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 37 "Chapter 7 The Diophantine Equations " }{XPPEDIT 18 0 "X^ n+Y^n = Z^n;" "6#/,&)%\"XG%\"nG\"\"\")%\"YGF'F()%\"ZGF'" }{TEXT -1 2 " . " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 95 " \+ There is not much need for Maple in this chapter. We do, however, \+ factor the expression " }{XPPEDIT 18 0 "a^p+b^p;" "6#,&)%\"aG%\"pG\"\" \")%\"bGF&F'" }{TEXT -1 8 ", where " }{XPPEDIT 18 0 "p;" "6#%\"pG" } {TEXT -1 39 " is a prime. Maple can do this for you." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "a lias(zeta = RootOf(x^4+x^3+x^2+x+1)):factor(a^5+b^5,zeta);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*,,&%\"aG\"\"\"*&%\"bGF&%%zetaGF&F&F&,&F%F&* &F(\"\"\")F)\"\"$F,F&F&,,F%F&F(!\"\"F'F0*&F(F,)F)\"\"#F,F0F+F0F&,&F%F& F1F&F&,&F%F&F(F&F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 " This is not quite what we expected . But remember " }{XPPEDIT 18 0 "zeta^4+zeta^3+zeta^2+zeta+1 = 0;" "6# /,,*$%%zetaG\"\"%\"\"\"*$F&\"\"$F(*$F&\"\"#F(F&F(\"\"\"F(\"\"!" } {TEXT -1 12 ", and hence " }{XPPEDIT 18 0 "a-b-b*zeta-b*zeta^2-b*zeta^ 3 = a-b*zeta^4;" "6#/,,%\"aG\"\"\"%\"bG!\"\"*&F'F&%%zetaGF&F(*&F'F&*$F *\"\"#F&F(*&F'F&*$F*\"\"$F&F(,&F%F&*&F'F&*$F*\"\"%F&F(" }{TEXT -1 1 ". " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 29 "Chapter 8 Gaussian Integers " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 103 " Maple can compute with \+ complex numbers. The symbol I is reserved for one of the square roots \+ of " }{XPPEDIT 18 0 "-1;" "6#,$\"\"\"!\"\"" }{TEXT -1 10 ". That is " }{XPPEDIT 18 0 "I = sqrt(-1);" "6#/%\"IG-%%sqrtG6#,$\"\"\"!\"\"" } {TEXT -1 1 "." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "(5+3*I)*(6-25*I);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&\"$0\"\"\"\"%\"IG!$2\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "(6-25*I)/(5+3*I);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# ,&#!#X\"#M\"\"\"%\"IG#!$V\"F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 " There is a Gaussian In teger package on Maple. The help screen " }{TEXT 306 9 "?GaussInt" } {TEXT -1 28 " will tell you all about it." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "with(GaussI nt);" }}{PARA 7 "" 1 "" {TEXT -1 33 "Warning, new definition for GIgcd " }}{PARA 12 "" 1 "" {XPPMATH 20 "6#7?%(GIbasisG%(GIchremG%*GIdivisorG %*GIfacpolyG%)GIfacsetG%)GIfactorG%*GIfactorsG%&GIgcdG%(GIgcdexG%*GIhe rmiteG%(GIissqrG%&GIlcmG%*GImcmbineG%*GInearestG%(GInodivG%'GInormG%)G InormalG%(GIorderG%&GIphiG%(GIprimeG%*GIquadresG%&GIquoG%&GIremG%(GIro otsG%(GIsieveG%(GIsmithG%*GIsqrfreeG%'GIsqrtG%-GIunitnormalG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "GIquo(8+7*I,3+4*I,'r');r;" } }{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&\"\"#\"\"\"%\"IG!\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "2*(3+4*I)+r;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&\"\")\"\"\"%\" IG\"\"(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "GInorm(7-3*I);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#e" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "GIfactor(18+246*I);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#**)-%!G6#,&\"\"\"F)%\"IGF)\"\"$\"\"\"-F&6#!\"$F)-F&6#,&F)F)F*\"\"#F) )-F&6#,&F/F)F*!\"#F3F," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "s implify(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#**)-%!G6#,&\"\"\"F)%\"I GF)\"\"$\"\"\"-F&6#!\"$F)-F&6#,&F)F)F*\"\"#F))-F&6#,&F/F)F*!\"#F3F," } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "expand(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&\"#=\"\"\"%\"IG\"$Y#" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 18 "GIfactor(9+129*I);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*(-%!G6#!\"$\"\"\"-F%6#,&F(F(%\"IGF(F(-F%6#,&!#BF(F,!#?F(" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "expand(%);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&\"\"*\"\"\"%\"IG\"$H\"" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "alpha:=26+7*I;beta:=-59-17*I;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&alphaG,&\"#E\"\"\"%\"IG\"\"(" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%betaG,&!#f\"\"\"%\"IG!#<" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 32 "GIgcdex(alpha,beta,'s','t');s;t;" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#,&\"\"#\"\"\"%\"IG\"\"&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$%\"IG\"\"(" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$%\"IG\"\"$" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "alpha*s+beta*t;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&\"\"#\"\"\"%\"IG\"\"&" }}}}}{MARK "9 20 1 " 0 }{VIEWOPTS 0 0 0 1 1 1803 }