372 ARITHMETIC (Make a web site) 4.5.4 fast on computers, but it
Monday, December 31st, 2007372 ARITHMETIC 4.5.4 fast on computers, but it is not very suitable for hand calculation. Fermat actually did not keep the running value of y; he would look at z2 -N and tell whether or not this quantity was a perfect square by looking at its least significant digits. (The last two digits of a perfect square must be 00, el, e4, 25, 06, or e9, where e is an even digit and o is an odd digit.) Therefore he avoided the operations of steps C2 and C3, replacing them by an occasional determination that a certain number is not a perfect square. Fermat s method of looking at the rightmost digits can, of course, be general- ized by using other moduli. Suppose for clarity that N = 11111, and consider the following table: m if smodm is then x2 modm is and (2 -N) mod m is 3 0, 172 0, 1, 1 1,2,2 5 0,1,2,3,4 0,1,4,4,1 4,0,3,3,0 7 0, 1,2,3,4,5,6 0,1,4,2,2,4,1 5,6,2,&O, 2,6 8 0, 1,2,3,4,5,6,7 0, 1,4,1,0,1,4,1 1,2,5,2,1,2,5,2 11 0, 1,2,3,4,5,6,7,8,9,10 0,1,4,9,5,3,3,5,9,4,1 lO,O, 3,8,4,2,2,4,8,3,0 If x2 -N is to be a perfect square y 2, it must have a residue mod m consistent with this fact, for all m. For example, if N = 11111 and zmod3 # 0, then (x2 -iV)mod3 = 2, so x2 -N cannot be a perfect square; therefore z must be a multiple of 3 whenever 11111 = x2 -y 2. The table tells us, in fact, that xmod3 =O; xmod5 =O, l,or4; xmod7 = 2, 3, 4, or 5; (13) zmod8 =Oor4(hencexmod4=0) ; x mod 11 = 1, 2, 4, 7, 9, or 10. This narrows down the search for z considerably. For example, x must be a multiple of 12. We must have x 2 [ml = 106, and it is easy to verify that the first value of x 2 106 that satisfies all of the conditions in (13) is x = 144. Now 1442 -11111 = 9625, and by attempting to take the square root of 9625 we find that it is not a square. The first value of x > 144 that satisfies (13) is x = 156. In this case 1562 -11111 = 13225 = 1152; so we have found the desired solution x = 156, y = 115. This calculation shows that 11111 = 41 . 271. The hand calculations involved in the above example are comparable to the amount of work required to divide 11111 by 13, 17, 19, 23, 29, 31, 37, and 41, even though the factors 41 and 271 are not very close to each other; thus we can see the advantages of Fermat s method. In place of the moduli considered in (13), we can use any powers of distinct primes. For example, if we had used 25 in place of 5, we would find that the only permissible values of xmod 25 are 0, 5, 6, 10, 15, 19, and 20. This gives more information than (13). In general, we will get more information modulo p2 than we do modulo p, for odd primes p, whenever x2 -N E 0 (modulo p) has a solution 5.
If you are looking for affordable and reliable webhost to host and run your business application visit our ftp web hosting services.