{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {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 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{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 1 0 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 1 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0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STYLE "" -1 294 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 295 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 296 "" 0 1 0 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 0 }{CSTYLE "" -1 298 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 299 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 300 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 301 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 302 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 303 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 304 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 305 "" 0 1 0 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 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 256 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 8 4 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 "Text Output " -1 258 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 3 1 3 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 14 "Assignment 3 " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 298 10 "Problem 1." } {TEXT -1 2 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 302 3 "(a)" }{TEXT -1 185 " Use a for-loop and a conditiona l statement to split the positive integers not greater than 20 into a \+ set P of prime numbers and a set Q of non-prime numbers. Display the s ets P and Q. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 303 3 "(b)" }{TEXT -1 49 " Use a for-loop and a conditional stat ement with " }{TEXT 299 5 "break" }{TEXT -1 65 " to compute the smalle st positive prime number greater than 1000." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 304 3 "(c)" }{TEXT -1 190 " Write a fo r ... in loop that constructs from a set S a new set R consisting of e ach element n in S divided by n+1. Apply it to the sets P and Q define d in (a) above and display the results." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 257 11 "Problem 2. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 270 11 "Definiti on." }{TEXT 279 25 " A positive integer n is " }{TEXT 269 7 "perfect" }{TEXT 280 49 " if the sum of its proper positive divisors is n." } {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 104 "\nFor example, the prop er positive divisors of 6 are 1, 2, and 3. Further 6 = 1 + 2 + 3. So 6 is perfect." }}{PARA 0 "" 0 "" {TEXT 268 6 " \n(a) " }{TEXT -1 108 "W rite a procedure which takes as input a positive integer n and returns the sum of all proper divisors of n." }{TEXT 262 1 " " }{TEXT -1 81 " Show how your procedure works for the following values of n: 2, 3, 4, \+ 6, 30, 900." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 4 "(b) " }{TEXT 263 34 "Using the procedure you wrote in " } {TEXT 281 3 "(a)" }{TEXT 282 1 " " }{TEXT -1 18 "write a procedure " } {TEXT 283 9 "isperfect" }{TEXT -1 55 " which takes as input a positive integer n and returns " }{TEXT 260 4 "true" }{TEXT -1 21 " if n is pe rfect and " }{TEXT 261 5 "false" }{TEXT -1 9 " if not. " }{TEXT 258 4 "Note" }{TEXT -1 53 ": proper divisors of n can not be greater than n /2. " }{TEXT 271 46 "Use the procedure to find all perfect numbers " } {XPPEDIT 18 0 "n <= 1000;" "6#1%\"nG\"%+5" }{TEXT 272 2 ". " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 259 17 "I nteresting Fact:" }{TEXT 284 293 " It is an open question whether or n ot there are any odd perfect numbers. So far no one has found one. In \+ number theory you learn the structure of the even perfect numbers. So \+ far only a finite number of even perfect numbers have been found. But \+ it is suspected that there are infinitely many." }{TEXT -1 1 " " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 264 11 "Problem 3 ." }{TEXT -1 3 " \n" }}{PARA 0 "" 0 "" {TEXT 285 10 "Definition" }{TEXT -1 6 ". The " }{TEXT 267 5 "order " }{TEXT -1 1 " " }{TEXT 274 13 "of an integer" }{TEXT -1 3 " a " } {TEXT 273 17 "modulo an integer" }{TEXT -1 59 " m is defined to be the least positive integer e such that " }{XPPEDIT 18 0 "`mod`(a^e,m) = 1 ;" "6#/-%$modG6$)%\"aG%\"eG%\"mG\"\"\"" }{TEXT -1 29 ". \n*(where e i s an integer)*" }}{PARA 0 "" 0 "" {TEXT -1 28 "\nWrite a procedure, ca ll it " }{TEXT 265 3 "Ord" }{TEXT -1 12 ", such that " }{TEXT 275 8 "O rd(a,m)" }{TEXT -1 9 " returns " }{TEXT 290 4 "FAIL" }{TEXT -1 46 " if the order does not exist and the order of " }{TEXT 297 10 "a modulo m " }{TEXT -1 18 " if it exists.\n\n" }{TEXT 286 91 "You may use the n umber theoretic result that the order of a modulo m exists if and only if " }{TEXT 276 13 "igcd(a,m) = 1" }{TEXT 287 46 ". Also you may use \+ the fact that the order of " }{TEXT 291 10 "a modulo m" }{TEXT 292 23 " is never greater than " }{TEXT 293 5 "m - 1" }{TEXT 294 24 ". [Note \+ that Maple uses " }{TEXT 277 4 "igcd" }{TEXT 288 49 " for the greatest common divisor of integers and " }{TEXT 278 3 "gcd" }{TEXT 289 46 " f or greatest common divisor of polynomials.] " }{TEXT -1 2 "\n\n" } {TEXT 300 4 "(a) " }{TEXT -1 23 "Check that you obtain: " }{TEXT 266 65 "\n\n Ord(0,11) = FAIL, Ord(2,11) = 10, Ord(4,11) = 5 ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 301 3 "(b) " }{TEXT -1 9 " Compute " }{TEXT 296 10 "Ord(a, 15)" }{TEXT -1 20 " fo r a from 0 to 20." }}{PARA 0 "" 0 "" {TEXT 295 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 305 13 "Extra Credit." }{TEXT -1 3 " \n" }}{PARA 0 "" 0 "" {TEXT -1 431 "Perhaps you have heard th e famous story about Ramanujan and Hardy's taxi number: Once when Rama nujan was ill in London, Hardy visited Ramanujan in the hospital. When Hardy remarked that he had taken taxi number 1729, a singularly unexc eptional number, Ramanujan immediately responded that this number was \+ actually quite remarkable: it is the smallest positive integer that ca n be represented in two ways by the sum of two cubes. [" }{TEXT 306 60 "from Eric Weisstein's Treasure Trove of Scientific Biography" } {TEXT -1 1 "]" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 428 "Verify (using Maple) Ramanujan's statement that 1729 is \+ the smallest positive integer that can be expressed in two different w ays as a sum of two cubes. You should be able to use the ideas in the \+ section above on perfect squares and sums of squares. [Use of the anal ogue of the procedure taking sums of squares, but here we are talking \+ of cubes instead of squares. There are other ways to do the problem t hat may occur to you.]" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 257 "" 0 "" {TEXT -1 8 "- End - " } }}}{MARK "4 10 0" 428 }{VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 1 1 2 33 1 1 }