{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 35 "" 0 1 104 64 92 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1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 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Author" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 8 8 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 259 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Title" -1 260 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }} {SECT 0 {EXCHG {PARA 260 "" 0 "" {TEXT -1 18 "Maple Worksheet #1" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 88 "Click on \+ a plus sign to open a section and click on the minus sign to close the section." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 14 "What is Maple?" }}{PARA 0 "" 0 "" {TEXT -1 55 "Maple is a programming language that can be used to do " }{TEXT 374 8 "symbolic " }{TEXT -1 12 " as well as " }{TEXT 375 9 "numerical" }{TEXT -1 217 " calculations in calculus, linear algebra, algebra, differential equat ions and many other areas of mathematics. Here we just concentrate on \+ the use of Maple in number theory. For more about Maple go to my homep age at " }{TEXT 349 32 "http://www.math.usf.edu/~eclark/" }{TEXT -1 66 " and follow the link under the picture on the upper right labeled \+ " }{TEXT 354 0 "" }{TEXT 353 4 "Some" }{TEXT -1 1 " " }{TEXT 350 14 "M aple Links.\n\n" }{TEXT -1 47 "In the USF computer labs you should fin d either" }{TEXT 351 9 " Maple 7 " }{TEXT -1 2 "or" }{TEXT 352 10 " Ma ple 8. " }{TEXT -1 57 "You may use either one. This worksheet was prep ared with " }{TEXT 355 7 "Maple 8" }{TEXT -1 3 ". " }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 "If you want a " }{TEXT 377 7 "smaller" }{TEXT -1 3 " or" }{TEXT 376 7 " larger" }{TEXT -1 84 " font click on one of the magnifying glasses on the menu bar at the t op right above." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 34 "Getting Started \+ - Basic Arithmetic" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "When you cli ck on the Maple Icon Maple will open up as a blank" }{TEXT 300 10 " wo rksheet" }{TEXT -1 15 ". To use Maple:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 42 "1. Type in a command or expression at the " }{TEXT 257 6 "prompt" }{TEXT -1 222 ", > . \n\n2. Be sure to \+ put a semicolon at the end of the line. Or, you may place a colon at \+ the end of the line if you don't want Maple to print the output.\n\n3. Then press the return key and you will see the result in a " }{TEXT 301 4 "blue" }{TEXT -1 22 " font. This is called " }{TEXT 256 9 "execu ting" }{TEXT -1 14 " the command. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 411 "Below are some examples that I have type d in to save you the trouble. Just place the cursor on the line of the first command (in the red font) below and hit the return key. You wil l see the output. The cursor will automatically go to the next line. H owever, if you wish to experiment (as you should!) you can replace the 2 by a 5 as you would with any wordprocessor and compute another sum, product or whatever." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "2+2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "2-4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "2*3; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "2^3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "2^4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "2^1000;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "1123^141; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "12/3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "2/997;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 147 "Maple does not convert fractions to floating-point numbers ( i .e., numbers containing a decimal point) unless you so request by use \+ of the command " }{TEXT 328 5 "evalf" }{TEXT -1 108 ", as in the follo wing example. Maple performs exact symbolic calculations to the extent possible. Note that " }{TEXT 302 5 "evalf" }{TEXT -1 12 " stands for \+ " }{TEXT 378 35 "evaluate as a floating-point number" }{TEXT -1 67 ". \+ It evaluate to 10 digits unless directed otherwise. The command " } {TEXT 329 11 "evalf[n](x)" }{TEXT -1 28 " will evaluate to n digits. \+ " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "evalf(2/997);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "evalf[100](2/997);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "sqrt(9);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 8 "sqrt(3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "Note that if you want a decimal approximation to " }{XPPEDIT 18 0 "sqrt(3);" "6#-%%sqrtG6#\"\"$" }{TEXT -1 20 " you must use evalf:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "evalf(sqrt(3));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "The Maple commands for the floor and ceil ing of a real number x are floor(x) and ceil(x):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "floor(997.333);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "floor(sqrt(3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "floor(sqrt(12345));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "Sometimes we must apply " }{TEXT 296 5 "evalf" }{TEXT -1 29 " t o make floor work properly." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "floor(sqrt(2^100 + 1));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "Th e following seems to work. (But it gives the wrong answer.)" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "floor(evalf(sqrt(2^100 + 1)) );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 179 "The reason this is not cor rect is that we have not approximated to enough decimal places. Consid er the following sequence of commands. Note that each answer changes t ill we reach " }{TEXT 330 9 "evalf[16]" }{TEXT -1 31 ". Here we use wh at is called a " }{TEXT 331 7 "do loop" }{TEXT -1 12 " to compute " } {TEXT 332 11 "evalf[i](x)" }{TEXT -1 33 " for i from 10 to 20. We disc uss " }{TEXT 333 8 "do loops" }{TEXT -1 12 " more later." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "for i from 10 to 20 do\n i, floor( evalf[i](sqrt(2^100 + 1)));\nend do;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "ceil(sqrt(3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "ceil(5.888);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "cei l(-5.888);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "ceil(sqrt(2^1 00 + 1));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "ceil(evalf[20] (sqrt(2^100 + 1)));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "We can com pute the greatest common divisor of two integers a and b by use of the command " }{TEXT 308 11 "igcd(a,b). " }{TEXT 334 79 "Note that the co mputation of the gcd is very fast. Even for very large integers" } {TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "igcd(12,15 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "igcd(2^10000 - 1,2^11 000 -1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 33 "Algebra, Calculus, Linear Algebra" }}{PARA 0 "" 0 "" {TEXT -1 184 "Just for fun in this section we illustrate briefly some Maple cap abilities that have little to do with number theory. Just execute the \+ following commands and you will see what they do:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "p:=(x+y+z)^2 ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "expand(p);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "q:=x^3+6*x^2*y+9*x^2*z+12*x*y^2+36* x*y*z+27*x*z^2+8*y^3+36*y^2*z+54*y*z^2+27*z^3;\nfactor(q);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "N ote that " }{TEXT 379 6 "factor" }{TEXT -1 35 " is used to factor poly nomials and " }{TEXT 380 7 "ifactor" }{TEXT -1 39 " is used to factor \+ integers. Similarly " }{TEXT 381 3 "gcd" }{TEXT -1 48 " is used to fin d the gcd of two polynomials and " }{TEXT 382 4 "igcd" }{TEXT -1 41 " \+ is used to find the gcd of two integers." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "Sum(1/n^2,n=1..infinity) = sum(1/n^2,n=1..infinity); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "Limit(sin(x)/(tan(x)^2+ x),x=0)=limit(sin(x)/(tan(x)^2+x),x=0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "Diff(x^5*sin(x),x)=diff(x^5*sin(x),x);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "Int(x^2*exp(x),x) = int(x^2*exp(x), x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "plot((x^2+1)*sin(x), x=-4*Pi..4*Pi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "If you click o n the plot below, you will find that you can rotate it using the mouse ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "plot3d(sin(x+Pi/2)*sin (x)*cos(y),x=-2..2,y=-2..2, axes=boxed);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "A:=Matrix([[1,2,3],[1,2,5],[7,8,9]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "LinearAlgebra[Determinant](A);" }}} }{SECT 1 {PARA 3 "" 0 "" {TEXT -1 53 "Upper case vs lower case and (), [], \{\} distinctions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 322 24 "Maple is case sensitive!" }{TEXT -1 16 " So for example " }{TEXT 323 2 "Pi" }{TEXT -1 5 " and " }{TEXT 324 2 " pi" }{TEXT -1 25 " are different in Maple. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 178 "One must not use square bracke ts, [ ], or braces, \{ \}, for grouping. Use only parentheses, ( \+ ). Here are some examples of correct use and incorrect use of these symbols:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "(2+3)+(5+7)^ 3 +x;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "See what happens when we try to use [ and ] or \{ and \} in place of ( and ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "[2+3] + \{5+7\}^3+x;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "The braces \{ \} are used for " }{TEXT 321 4 "sets" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "\{2,3,4\} union \{x,y,2\};\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "\{2,3,4\} intersect \{x,y,2\};\n" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 39 "Square brackets, [ and ], are used for " }{TEXT 320 5 "lists" }{TEXT -1 22 " (i.e., for n-tuples):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "[2,3,3,3,4,5];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Compare with set notation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "\{2,3,3,3,4,5\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 12 "Getting Hel p" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 140 "One can obtain information about various Maple functions in one o f several ways.:\n\n1. One way is to go to the pull down menu and look under " }{TEXT 303 4 "Help" }{TEXT -1 62 " for one of the various cho ices for getting help given there. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 113 "2. Another way is to type a question ma rk followed by a command you want to know more about. Here is an examp le:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "?factor\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Note that " }{TEXT 277 6 "factor" }{TEXT -1 52 " is used to factor polynomials and not integers -- " } {TEXT 278 7 "ifactor" }{TEXT -1 31 " is used to factor an integer.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "?ifactor\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "3. Or you may highlight a word you are in terested in then hit the " }{TEXT 383 2 "f1" }{TEXT -1 42 " key (or go to the Help pull down menu to " }{TEXT 279 17 "Help on Context)." } {TEXT -1 47 " This will bring up the help page on the item." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 157 "4. If you have special difficulties with some aspect of Maple when working the exerc ises you may sent me an email including the program. My email address \+ is " }{TEXT 280 20 "eclark@math.usf.edu " }{TEXT -1 175 "It is possibl e to send me your worksheet as an attachment. If you do please try to \+ indicate carefully exactly what the problem is. Also give the workshee t a name of the form " }{TEXT 281 14 "john_doe.mws " }{TEXT -1 29 "N ote that it should end with " }{TEXT 282 4 ".mws" }{TEXT -1 43 " and t here should be no spaces in the name." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 29 "Basic Numbe r Theory Functions" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 117 "Now we illustrate some number theory functions. S ome of these require loading the Maple number theory package called " }{TEXT 258 9 "numtheory" }{TEXT -1 40 ". This is done by executing the command " }{MPLTEXT 1 0 16 "with(numtheory);" }{TEXT 384 1 " " } {TEXT -1 210 "To keep from having to remember which commands require t he package and which do not, since this is a number theory course, we \+ load the package to begin with. Note that only the commands listed aft er we execute " }{TEXT 259 16 "with(numtheory);" }{TEXT -1 147 " requ ire it. The other commands we use can be used without this command. So me commands that do not require the package numtheory to be loaded are " }{TEXT 335 35 "isprime, ithprime, igcd, irem, iquo" }{TEXT -1 26 ". It is enough to execute " }{TEXT 327 15 "with(numtheory)" }{TEXT -1 19 " once per session. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 " with(numtheory);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "If you look i n this list you will find " }{XPPEDIT 18 0 "lambda,phi,pi,sigma,tau;" "6'%'lambdaG%$phiG%#piG%&sigmaG%$tauG" }{TEXT -1 37 ". To type them in use, respectively, " }{TEXT 336 27 "lambda, phi, pi, sigma, tau" } {TEXT -1 22 ". We have not studied " }{XPPEDIT 18 0 "lambda;" "6#%'lam bdaG" }{TEXT -1 32 " in the course, but the others " }{XPPEDIT 18 0 " phi,pi,sigma,tau" "6&%$phiG%#piG%&sigmaG%$tauG" }{TEXT 304 1 " " } {TEXT -1 60 "have the same meaning given in the course notes. Note, th at " }{TEXT 385 5 "pi(x)" }{TEXT -1 95 " gives the number of primes le ss than x. Maple is case sensitive. Pi and pi are not the same. " } {TEXT 386 2 "Pi" }{TEXT -1 65 " is the ratio of the circumference to t he diameter of a circle. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "pi(100);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "evalf[100](P i);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "As noted above " }{TEXT 372 10 "ifactor(n)" }{TEXT -1 85 " returns the prime factors of n--PRO VIDED that n is not too large. If n is too large " }{TEXT 373 10 "ifac tor(n)" }{TEXT -1 98 " will cause Maple to go on forever or crash, so be careful when trying to factor large numbers. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "ifactor(1234567);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 31 "Let's check this factorization:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 9 "127*9721;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "ifactor(2^(2^5) + 1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "ifactor(2^(2^6) + 1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 138 "If you replace the 6 in the above by a 7 you will find t hat Maple takes a long time to factor this 7th Fermat number. But see \+ the command " }{TEXT 305 6 "fermat" }{TEXT -1 17 " discussed below:" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "If you \+ execute the following you may stop it by clicking on the STOP sign at \+ the top of the worksheet menu. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "ifactor(2^(2^7)+1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "Th e command " }{TEXT 371 9 "length(n)" }{TEXT -1 79 " will tell how many digits are in an integer. We first look at a large integer." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "2^1000 - 3^10 + 1;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "length(2^1000-3^10 + 1); " } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "Maple knows the binary function \+ " }{TEXT 306 4 "mod:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "10 m od 7;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "-1 mod 10;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "2^340 mod 341;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "See the section below titled " }{TEXT 307 25 "Computing powers modulo m" }{TEXT -1 41 " for a faster way to \+ compute such powers." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "Note that parentheses are important. Compare th e results of the following three commands:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 13 "10 + 5 mod 3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "(10 + 5) mod 3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "10 + (5 mod 5);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "\nComputing the inverse of an integer a modulo m is very simple in Maple:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "1/385 mod 37981; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "Let's check it:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "385*20125 mod 37981;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "Note that if gcd(a,m) > 1 then the invers e of a modulo m does not exist:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "1/25 mod 1005;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "The com mand " }{TEXT 297 8 "irem(a,b" }{TEXT -1 66 ") gives the remainder whe n a is divided by b. This is the same as " }{TEXT 298 9 "a mod b. " } {TEXT -1 12 "The command " }{TEXT 299 9 "iquo(a,b)" }{TEXT -1 54 " giv es the quotient when a is divided by b. Note that " }}{PARA 0 "" 0 "" {TEXT -1 109 " a = b*iqu o(a,b) + irem(a,b)\nfor all positive integers a and b." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "irem(14,4);\n14 mod 4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "iquo(14,4);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 26 "4*iquo(14,4) + irem(14,4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "Here's how to get the divisors of a positive inte ger:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "divisors(28);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "Here's a way to add up these divisors:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "add(d,d=\{1,2,4,7,14,2 8\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "This may also be accompl ished with the built-in Maple procedure " }{TEXT 337 5 "sigma" }{TEXT -1 2 ". " }{TEXT 338 8 "sigma(n)" }{TEXT -1 9 " returns " }{XPPEDIT 18 0 "sigma(n);" "6#-%&sigmaG6#%\"nG" }{TEXT -1 48 " which is the sum \+ of the positive divisors of n." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "sigma(28);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 102 "Note that sigma(n) - n is the sum of the prope r divisors of n, that is, those divisors not equal to n." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "sigma(28) - 28;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "divisors(6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "sigma(6);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "sigma(6) - 6;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "2^6*(2 ^7-1); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "sigma(8128) - 81 28;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 15 "" 0 " " {TEXT 260 3 "phi" }{TEXT -1 17 "(n) will return " }{XPPEDIT 18 0 "p hi(n);" "6#-%$phiG6#%\"nG" }{TEXT -1 85 " which is the number of posit ive integers not exceeding n and relatively prime to n. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "phi(12);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 12 "phi(123456);" }}}{EXCHG {PARA 15 "" 0 "" {TEXT 35 6 "pi(n) " }{TEXT -1 13 " will return " }{XPPEDIT 18 0 "pi(n);" "6#-%# piG6#%\"nG" }{TEXT -1 75 " which the number of prime numbers less than or equal to the given integer " }{TEXT 35 1 "n" }{XPPEDIT 18 0 "" "6# %#%?G" }{TEXT -1 2 ". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "pi (2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "pi(3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "pi(4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "pi(1000);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "pi(10000);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "pi(10^6); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 261 11 " tau(n) " }{TEXT -1 12 "w ill return " }{XPPEDIT 18 0 "tau(n);" "6#-%$tauG6#%\"nG" }{TEXT -1 47 " which is the number of positive divisors of n." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "divisors(12);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "tau(12);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "divisors(123456789);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "ta u(123456789);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 14 "Fermat Numbers" }}{EXCHG {PARA 15 "" 0 "" {TEXT -1 25 "The nth Fermat number is " }{XPPEDIT 18 0 "2^( 2^n)+1;" "6#,&)\"\"#)F%%\"nG\"\"\"F(F(" }{TEXT -1 37 " (or 2^(2^n)+1 in Maple notation. )" }}{PARA 15 "" 0 "" {TEXT 270 8 "fermat(n" } {TEXT -1 45 ") returns the nth Fermat number, for n < 20. " }}{PARA 15 "" 0 "" {TEXT -1 76 "For any non-negative integer n and unassigned \+ variable w, the function call " }{TEXT 271 11 "fermat(n,w)" }{TEXT -1 108 " assigns to w the information which is known (at the time of writ ing this function) about the Fermat number " }{TEXT 294 9 "fermat(n)" }{TEXT -1 59 ". This information consists of: the primality character \+ of " }{TEXT 272 9 "fermat(n)" }{TEXT -1 82 " (prime, composite or unkn own), and, if it is composite, any known prime factors. " }}{PARA 0 " " 0 "" {TEXT -1 3 "If " }{TEXT 273 6 "fermat" }{TEXT -1 149 " is invok ed with no arguments, it returns a list of all Fermat numbers whose pr imality status is known as of the time when this function was written. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "Execu ting the following will illustrate the fermat command:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "fermat( );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "fermat(4,w1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "w1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "fermat(5,w2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "w2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "ferm at(9,w3); w3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "fermat(10, w7); w7;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "fermat(23471,w5 ); w5;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 42 "isprime, nextprime, prevprime and ithprim e" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "The command " }{TEXT 309 7 "isprime" }{TEXT -1 11 "(n) return " } {TEXT 310 4 "true" }{TEXT -1 19 " if n if prime and " }{TEXT 311 5 "fa lse" }{TEXT -1 30 " if n is not prime. [Actually " }{TEXT 339 8 "ispri me " }{TEXT -1 5 "is a " }{TEXT 314 30 "probabilistic primality tester " }{TEXT -1 242 ", but so far no one has an example where it fails to \+ give the right answer. One can be certain that the number is not prime if the output is false but if the output is true there is the theoret ical possibility that the number is not prime.] " }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 12 "isprime(11);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "isprime(10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "isprime(2^7-1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "is prime(2^11-1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "isprime(2 ^32 + 1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 13 "The function " } {TEXT 312 7 "isprime" }{TEXT -1 44 " will handle much larger integers \+ than will " }{TEXT 313 7 "ifactor" }{TEXT -1 36 ". Recall the difficul ty we had with " }{TEXT 340 18 "ifactor(2^(2^7)+1)" }{TEXT -1 102 " ab ove. Observe, however, how rapidly Maple shows that the 7th and 10th F ermat numbers are not prime. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "isprime(2^(2^7)+1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "isprime(2^(2^10)+1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 267 9 "nextprime " }{TEXT -1 64 " function returns the smallest prime that is larger th an n. The " }{TEXT 268 9 "prevprime" }{TEXT -1 56 " function returns t he largest prime that is less than n." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "nextprime(2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "nextprime(3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "pr evprime(5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "nextprime(10 00000);\nprevprime(1000000);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "nextprime(10^100);\nprevprime(10^100);" }}}{EXCHG {PARA 15 "" 0 "" {TEXT -1 13 "The function " }{TEXT 274 8 "ithprime" }{TEXT -1 67 " \+ returns the ith prime number, where the first prime number is 2. ." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "ithprime(1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "ithprime(2);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 14 "ithprime(100);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "ithprime(10000);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 15 "Mersenne Pr imes" }}{EXCHG {PARA 15 "" 0 "" {TEXT -1 13 "The function " }{TEXT 275 8 "mersenne" }{TEXT -1 79 "(n) will compute the nth Mersenne numbe r. If the argument n is an integer then " }{TEXT 266 11 "mersenne(n)" }{TEXT -1 13 " will return " }{TEXT 264 5 "2^n-1" }{TEXT -1 4 " if " } {TEXT 265 5 "2^n-1" }{TEXT -1 91 " is known to be prime. Otherwise, if n is prime, but 2^n-1 is not determinably prime, then " }{TEXT 269 11 "mersenne(n)" }{TEXT -1 13 " will return " }{TEXT 262 4 "FAIL" } {TEXT -1 44 ". Finally, if n is composite it will return " }{TEXT 263 5 "false" }{TEXT -1 2 ". " }}{PARA 15 "" 0 "" {TEXT -1 61 "If the argu ment is a list with one integer element [i], then " }{TEXT 276 13 "mer senne([i])" }{TEXT -1 130 " will return the ith Mersenne prime. If the value is beyond Maple's precomputed list of Mersenne primes, an error will be issued. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "mersenne(2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "mersenne(3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "mersenne(4);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 55 "for n from 1 to 13 do \n n,2^n-1,mersenne(n) ; \nend do;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "Now we assign to p the value of the small est prime greater than " }{XPPEDIT 18 0 "10^20;" "6#*$\"#5\"#?" } {TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "p:=nextpri me(10^20);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "mersenne(p); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 150 "Maple has builtin a list of \+ the Mersenne primes found since it's last version. We can see what the first 10 are are by use of the following do loop: (" }{TEXT 341 119 " You don't want to go too far since the most recent Mersenne primes are very large and take a lot of time to print out.)" }{TEXT -1 117 " A ctually by viewing the program I can see that there are 36 in Maple 7 \+ and 39 in the most recent version Maple 8. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "for i from 1 to 10 do\n i,mersenne([i]);\nend do; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "The following command will al low you to see the Maple program " }{TEXT 342 8 "mersenne" }{TEXT -1 37 ". Execute it in case you are curious." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 30 "showstat(numtheory[mersenne]);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 22 "Ho mework Assignment #1" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 318 21 "Startup Instructions:" }{TEXT -1 2 " " } {TEXT 319 63 "For each assignment use the following steps to make a he ading. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 31 "a. Open a new Maple worksheet. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 16 "b. Click on the " }{TEXT 283 1 "T" } {TEXT -1 54 " on the menu bar. This will allow you to insert text. " } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "c. Go to the pull down menu on the left side where it says " }{TEXT 315 1 "P" }{TEXT -1 1 " " }{TEXT 316 6 "Normal" }{TEXT -1 33 ". Pull this down t ill you get to " }{TEXT 284 7 "Title. " }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 8 "d. Type " }{TEXT 285 25 "Homework Assi gnment # 1. " }{TEXT -1 37 " Then hit return and type your name. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 23 "e. Click \+ on the button " }{TEXT 343 2 "[>" }{TEXT -1 18 " on the menu bar. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "f. Click \+ on " }{TEXT 287 1 "T" }{TEXT -1 16 " again and type " }{TEXT 288 9 "pr oblem 1" }{TEXT -1 55 ". (To make it bold you must select it and then \+ hit the " }{TEXT 286 1 "B" }{TEXT -1 75 " button on the menu bar. If y ou select something that is in bold and click " }{TEXT 317 1 "B" } {TEXT -1 52 " again it will revert to normal. Use of the buttons " } {TEXT 344 1 "I" }{TEXT -1 5 " and " }{TEXT 345 1 "U" }{TEXT -1 20 " wi ll similarly get " }{TEXT 346 7 "italics" }{TEXT -1 5 " and " }{TEXT 347 11 "underlining" }{TEXT -1 10 " for you.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 13 "g. Click on " }{TEXT 289 3 "[> " }{TEXT -1 49 " again. This will give you an input prompt. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 " h. Then solve " }{TEXT 295 9 "problem 1" }{TEXT -1 60 " the next probl em. Similarly label each problem in this way." }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 290 12 "problem 1. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 325 4 "(a) " }{TEXT -1 34 "Find a prim e p larger than 1,000. " }}{PARA 0 "" 0 "" {TEXT -1 1 "(" }{TEXT 326 1 "b" }{TEXT -1 35 ") Determine if the Mersenne number " }{XPPEDIT 18 0 "2^p-1;" "6#,&)\"\"#%\"pG\"\"\"F'!\"\"" }{TEXT -1 17 " is prime or n ot." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 356 3 "(c )" }{TEXT -1 43 " Find the largest prime less than 10^100. \n" }} {PARA 0 "" 0 "" {TEXT 357 3 "(d)" }{TEXT -1 45 " Find the smallest pri me greater than 10^100." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 358 4 "(e) " }{TEXT -1 21 "Find the 100th prime." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 291 9 "problem 2" } {TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 42 " \n(a) Find the greates t common divisor of " }{XPPEDIT 18 0 "2^12345-1;" "6#,&*$\"\"#\"&XB\" \"\"\"F'!\"\"" }{TEXT -1 9 " and " }{XPPEDIT 18 0 "2^54321-1;" "6# ,&*$\"\"#\"&@V&\"\"\"F'!\"\"" }{TEXT -1 60 ".\n\n(b) Verify for severa l different values of n and m that " }{XPPEDIT 18 0 "igcd(2^n-1,2^m-1 ) = 2^igcd(n,m)-1;" "6#/-%%igcdG6$,&)\"\"#%\"nG\"\"\"F+!\"\",&)F)%\"mG F+F+F,,&)F)-F%6$F*F/F+F+F," }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 292 10 "problem 3." }}{PARA 0 "" 0 "" {TEXT 387 1 " \+ " }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 64 "(a) Determine how man y positive integers have exactly 5 digits. " }{TEXT 388 4 "Hint" } {TEXT -1 102 ": Check your method by finding first the answer for 1 di git, for 2 digits, for 3 digits, for 4 digits." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "(b) Find the number of pr imes that contain exactly 5 digits. " }{TEXT 370 5 "Hint:" }{TEXT -1 20 " The answer will be " }{XPPEDIT 18 0 "pi(a)-pi(b);" "6#,&-%#piG6#% \"aG\"\"\"-F%6#%\"bG!\"\"" }{TEXT -1 43 " for appropriately chosen int egers a and b." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 293 11 "problem 4. " }{TEXT -1 39 " What is known about the Fermat number " }{XPPEDIT 18 0 "F[30];" "6#&%\"FG6#\"#I" } {TEXT -1 3 " = " }{XPPEDIT 18 0 "2^(2^30)+1;" "6#,&)\"\"#*$F%\"#I\"\" \"F(F(" }{TEXT -1 1 "?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 359 10 "problem 5." }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 360 3 "(a)" }{TEXT -1 6 " Find " }{XPPEDIT 18 0 " phi(n);" "6#-%$phiG6#%\"nG" }{TEXT -1 82 " for the following values of n: 2,3,5,7,13, 17, 19, 29. Do you notice a pattern?\n" }}{PARA 0 "" 0 "" {TEXT 361 3 "(b)" }{TEXT -1 6 " Find " }{XPPEDIT 18 0 "phi(n);" " 6#-%$phiG6#%\"nG" }{TEXT -1 33 " for the following values of n: " } {XPPEDIT 18 0 "17^2,19^3,29^4;" "6%*$\"#<\"\"#*$\"#>\"\"$*$\"#H\"\"%" }{TEXT -1 28 ". Verify that in each case " }{XPPEDIT 18 0 "phi(p^n) = p^n-p^(n-1);" "6#/-%$phiG6#)%\"pG%\"nG,&)F(F)\"\"\")F(,&F)F,F,!\"\"F/ " }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 362 3 "(c)" }{TEXT -1 65 " Verify for several values of n and m \+ that if igcd(n,m) = 1 then " }{XPPEDIT 18 0 "phi(n*m) = phi(n)*phi(m); " "6#/-%$phiG6#*&%\"nG\"\"\"%\"mGF)*&-F%6#F(F)-F%6#F*F)" }{TEXT -1 1 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 363 9 "prob lem 6" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT 365 4 "(a) " }{TEXT -1 42 "How many digit are in the Mersenne number " }{TEXT 364 0 "" } {XPPEDIT 18 0 "2^101-1;" "6#,&*$\"\"#\"$,\"\"\"\"F'!\"\"" }{TEXT -1 2 ".\n" }}{PARA 0 "" 0 "" {TEXT 366 3 "(b)" }{TEXT -1 33 " Is the number in part (a) prime?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT 367 3 "(c)" }{TEXT -1 47 " Find the factorization of the Merse nne number " }{XPPEDIT 18 0 "2^100-1;" "6#,&*$\"\"#\"$+\"\"\"\"F'!\"\" " }{TEXT -1 20 ". (Note this is not " }{XPPEDIT 18 0 "2^101-1" "6#,&*$ \"\"#\"$,\"\"\"\"F'!\"\"" }{TEXT -1 2 ".)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 348 10 "problem 7." }{TEXT -1 2 " \n" }} {PARA 0 "" 0 "" {TEXT 368 3 "(a)" }{TEXT -1 75 " Find the inverse of \+ 2 modulo 456789 and check that the answer is correct." }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 369 3 "(b)" }{TEXT -1 121 " Find all the int egers in the set \{1,2,3, . . ., 14\} that have inverses modulo 15.\nC heck on your answer: There should be " }{XPPEDIT 18 0 "phi(15);" "6#-% $phiG6#\"#:" }{TEXT -1 9 " of them." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "3" 0 } {VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 1 0 2 33 1 1 }