MATH 313: SOLUTIONS HW3 Problem 1 (a) 30941 We use the Miller-Rabin test to check if it prime. We know that the smallest number which is a strong pseudoprime both base 2 and base 3 is 1373653; hence, if 30941 passes the test for both base 2 and base 3 it will have to be prime since 30941 < 1373653. Base 2: 30490 = 2 2 7735. 2 7735 5826 (mod 30941). 2 15490 1 (mod 30941) pass the test. Base 3: 3 7735 5826 (mod 30941). 2 15490 1 (mod 30941) pass the test. Therefore 30941 is prime and we are done! (b) 33918 Base 2: 33918 = 2 16959. 2 16959 8186 (mod 33919). 2 33918 20571 (mod 33919). Fail the test! so 33919 is composite. {2, 3, 5, 7, 17, 19, 31, 37, 43, 47, 53}. Also note that 33919 = 184 and we find that sieving between 170 and 203 is sufficient. Q(173)Q(177)Q(188)Q(193)Q(203) = ( 2 3 5 7 19)( 2 5 7 37)(3 5 2 19)(2 3 2 5 37)(2 3 6 5) = 2 4 3 10 5 6 19 2 37 2.
gcd((173 177 188 193 203) (2 2 3 5 5 3 19 37), 33919) = 317 gcd((173 177 188 193 203) + (2 2 3 5 5 3 19 37), 33919) = 107 Hence, 33919 = 107 317. (c) 68569 Base 2: 68568 = 2 3 8571. 2 8571 14870 (mod 68569). 2 17142 50444 (mod 68569). 2 34284 1546 (mod 68569). 2 68568 58770 (mod 68569). Fail the test! so 68569 is composite. {2, 3, 5, 7, 17, 19, 23, 29, 31, 53, 61}. Also note that 68569 = 262 and we find that sieving between 242 and 282 is sufficient. Q(262)Q(263)Q(264)Q(265) = (3 5 2 )(2 3 3 5)(7 2 23)(2 3 3 2 23) = 2 6 3 4 5 4 7 2 23 2. gcd((262 263 264 265) (2 3 3 2 5 2 7 23), 68569) = 191 gcd((262 263 264 265) (2 3 3 2 5 2 7 23), 68569) = 359 Hence, 68569 = 191 359. (d) 838861 Base 2: 838860 = 2 3 8571. 2 209715 2048 (mod 838861). 2 419430 1 (mod 838861). Pass the test! so 838861 can be a prime.
Base 3: 3 209715 456516 (mod 838861). 2 419430 231416 (mod 838861). 2 838860 478816 (mod 838861). Fail the test! so 838861 is a composite. {2, 3, 5, 7, 11, 13, 17, 19, 29, 31, 37}. Also note that 838861 = 916 and we find that sieving between 896 and 936 is sufficient. Q(917)Q(923) = (2 2 3 13 2 )(2 2 3 3 11 2 ) = 2 4 3 4 11 2 13 2. gcd((917 923) (2 2 3 2 11 13), 838861) = 397 gcd((917 923) + (2 2 3 2 11 13), 838861) = 2113 Hence, 838861 = 371 2113. (e) 1016801 Base 2: 1016800 = 2 5 31775. 2 31775 1 (mod 1016801). Pass the test! so 1016800 can be a prime. Base 3: 3 209715 509141 (mod 1016801). 3 63550 294140 (mod 1016801). 3 127100 776112 (mod 1016801). 3 254200 991348 (mod 1016801). 3 508400 152972 (mod 1016801). 3 1016800 791371 (mod 1016801). Fail the test! so 1016800 is a composite. {2, 5, 7, 11, 19, 29, 31, 37, 41, 3, 47, 53}.
Also note that 1016801 = 1008 and we find that sieving between 978 and 1038 is sufficient. Q(991)Q(999)Q(1011)Q(1022) = ( 2 5 5 7 31)( 2 4 5 2 47)(2 3 5 7 19)(19 31 47) = 2 12 5 4 7 2 19 2 31 2 47 2. gcd((991 999 1011 1022) (2 6 5 2 7 19 31 47), 1016801) = 4051 gcd((991 999 1011 1022) + (2 6 5 2 7 19 31 47), 1016801) = 251 Hence, 1016801 = 4051 251. (f) 1149847 Base 2: 1149846 = 2 574923. 2 574923 923023 (mod 1149847). 2 1149846 372808 (mod 1149847). Fail the test! so 1149847 is a composite. {2, 3, 13, 17, 19, 23, 41, 61, 67, 71, 73}. Also note that 1149847 = 1072 and we find that sieving between 1012 and 1131 is sufficient. Q(1077)Q(1085) = (2 71 2 )(2 3 4 13 2 ) = 2 2 3 4 13 2 71 2. gcd((1077 1085) (2 3 2 13 71), 1149847) = 521 gcd((1077 1085) + (2 3 2 13 71), 1149847) = 2207 Hence, 1149847 = 521 2207.
Problem 2 Here are 6 possible factors: (1) Q(103) Q(107) = 2 10 7 2. 2 potential factors: gcd(103 107 + 2 10 7 2, 10553) gcd(103 107 2 10 7 2, 10553) (2) Q(103) Q(110) Q(111) = 2 6 7 2 13 2 17 2. 2 potential factors: gcd(103 110 111 + 2 6 7 2 13 2 17 2, 10553) gcd(103 110 111 2 6 7 2 13 2 17 2, 10553) (3) Q(107) Q(110) Q(111) = 2 10 7 2 13 2 17 2. 2 potential factors: gcd(107 110 111 + 2 10 7 2 13 2 17 2, 10553) gcd(107 110 111 2 10 7 2 13 2 17 2, 10553) Problem 3 Note that the form p 2 k 2047q2 k = ±Q k 1 p 2 k ±Q k 1 (mod 2047). In order to use the quadratic sieve, we want the product of some (±Q k 1 ) to be a perfect square. Observe that in the Q k+1 given, we already have a perfect square when p k = 181 and Q k+1 = 3 2. Therefore, we can use this one to try to factorize 2047. Following the observation above, we have: 181 2 3 2 (mod 2047). Now, we find that gcd(181 + 3, 2047) = 23 and 2047/23 = 89. Hence, we get 2047 = 23 89. The period is at least 5. Problem 4 Let s look at the first few convergents of 154421. Note: You were supposed to compute the convergents using the algorithm used in class. I will omit this step in the solution, but you should be able to obtain the same 6 first convergents by going through the algorithm. [Steps of the algorithm: (1) compute α i s and a i s, (2) find p i s and q i s. You now have the convergents and are able to compute Q i s.]
First convergent: 392 392 2 154421 1 2 = 757. Not a perfect square. Second convergent: 393 393 2 154421 1 2 = 28 = 2 2 7. Not a perfect square and cannot get a perfect square with a product of previous convergents. Third convergent: 11003/28 11003 2 154421 28 2 = 55 = 5 11. Not a perfect square and cannot get a perfect square with a product of previous convergents. Fourth convergent: 154435/393 154435 2 154421 393 2 = 196 = 2 2 7 2 = 14 2. Perfect square. We can compute the gcd to find out if it gives us a factorization: gdc(154435 + 14, 154421) = 1 and gdc(154435 14, 154421) = 154421. So it doesn t give us a factorization! We continue looking at convergents... Fifth convergent: 474308/1207 474308 2 154421 1207 2 = 565 = 5 113. Not a perfect square and cannot get a perfect square with a product of previous convergents. Sixth convergent: 628743/1600 628743 2 154421 1600 2 = 49 = 7 2. Perfect square. We can compute the gcd to find out if it gives us a factorization: gdc(628743 + 7, 154421) = 503 and 154421/503 = 307. Hence we get 154421 = 307 503.